# Interaction

Namespace: **Wisej.Web.VisualBasic**

Assembly: **Wisej.Framework** (4.0.0.0)

Replaces the visual methods in Microsoft.VisualBasic.Interaction.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Interaction
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Interaction
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
In Visual Basic and C#, you can call this method as an instance method on any object of type [Object](https://docs.microsoft.com/dotnet/api/system.object). When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods).
{% endhint %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Beep(Target, AudioBase64)

Sounds a tone through the computer's speaker.

| Parameter                                                                                                                                                                                                                     | Type                                                          | Description                                                               |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------- |
| **Target**                                                                                                                                                                                                                    | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Context object that initiated this call.                                  |
| **AudioBase64** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [String](https://docs.microsoft.com/dotnet/api/system.string) | Optional. Custom audio stream. If omitted the default beep wav is played. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) InputBox(Target, Prompt, Title, DefaultResponse, XPos, YPos, CloseCallback)

Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.

| Parameter                                                                                                                                                                                                                         | Type                                                                     | Description                                                                                                                                                                                             |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target**                                                                                                                                                                                                                        | [Object](https://docs.microsoft.com/dotnet/api/system.object)            | Context object that initiated this call.                                                                                                                                                                |
| **Prompt**                                                                                                                                                                                                                        | [String](https://docs.microsoft.com/dotnet/api/system.string)            | Required String expression displayed as the message in the dialog box.                                                                                                                                  |
| **Title** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)           | [String](https://docs.microsoft.com/dotnet/api/system.string)            | Optional. String expression displayed in the title bar of the dialog box. If you omit *Title* , the application name is placed in the title bar.                                                        |
| **DefaultResponse** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [String](https://docs.microsoft.com/dotnet/api/system.string)            | Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit *DefaultResponse* , the displayed text box is empty.                           |
| **XPos** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)              | Optional. Numeric expression that specifies, in pixels, the distance of the left edge of the dialog box from the left edge of the screen. If you omit *XPos* , the dialog box is centered horizontally. |
| **YPos** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)              | Optional. Numeric expression that specifies, in pixels, the distance of the upper edge of the dialog box from the top of the screen. If you omit *YPos* , the dialog box is centered vertically.        |
| **CloseCallback** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)   | [Action\<String>](https://docs.microsoft.com/dotnet/api/system.action-1) | Optional. Asynchronous callback.                                                                                                                                                                        |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The contents of the text box.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) InputBoxAsync(Target, Prompt, Title, DefaultResponse, XPos, YPos)

Asynchronous displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.

| Parameter                                                                                                                                                                                                                         | Type                                                          | Description                                                                                                                                                                                             |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target**                                                                                                                                                                                                                        | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Context object that initiated this call.                                                                                                                                                                |
| **Prompt**                                                                                                                                                                                                                        | [String](https://docs.microsoft.com/dotnet/api/system.string) | Required String expression displayed as the message in the dialog box.                                                                                                                                  |
| **Title** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)           | [String](https://docs.microsoft.com/dotnet/api/system.string) | Optional. String expression displayed in the title bar of the dialog box. If you omit *Title* , the application name is placed in the title bar.                                                        |
| **DefaultResponse** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [String](https://docs.microsoft.com/dotnet/api/system.string) | Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit *DefaultResponse* , the displayed text box is empty.                           |
| **XPos** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | Optional. Numeric expression that specifies, in pixels, the distance of the left edge of the dialog box from the left edge of the screen. If you omit *XPos* , the dialog box is centered horizontally. |
| **YPos** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | Optional. Numeric expression that specifies, in pixels, the distance of the upper edge of the dialog box from the top of the screen. If you omit *YPos* , the dialog box is centered vertically.        |

**Returns:** [Task\<String>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). The contents of the text box.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) MsgBox(Target, Prompt, Buttons, Title, CloseCallback)

Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked.

| Parameter                                                                                                                                                                                                                       | Type                                                                                                         | Description                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target**                                                                                                                                                                                                                      | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Context object that initiated this call.                                                                                                                                                                                                                        |
| **Prompt**                                                                                                                                                                                                                      | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Required. String expression displayed as the message in the dialog box.                                                                                                                                                                                         |
| **Buttons** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)       | [MsgBoxStyle](https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxstyle) | Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If you omit *Buttons* , the default value is zero. |
| **Title** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)         | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Optional. String expression displayed in the title bar of the dialog box. If you omit *Title* , the application name is placed in the title bar.                                                                                                                |
| **CloseCallback** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Action\<MsgBoxResult>](https://docs.microsoft.com/dotnet/api/system.action-1)                               | Optional. Asynchronous callback.                                                                                                                                                                                                                                |

**Returns:** [MsgBoxResult](https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxresult). One of [MsgBoxResult](https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxresult).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) MsgBoxAsync(Target, Prompt, Buttons, Title)

Asynchronously displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked.

| Parameter                                                                                                                                                                                                                 | Type                                                                                                         | Description                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target**                                                                                                                                                                                                                | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Context object that initiated this call.                                                                                                                                                                                                                        |
| **Prompt**                                                                                                                                                                                                                | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Required. String expression displayed as the message in the dialog box.                                                                                                                                                                                         |
| **Buttons** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [MsgBoxStyle](https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxstyle) | Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If you omit *Buttons* , the default value is zero. |
| **Title** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)   | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | Optional. String expression displayed in the title bar of the dialog box. If you omit *Title* , the application name is placed in the title bar.                                                                                                                |

**Returns:** [Task\<MsgBoxResult>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). One of [MsgBoxResult](https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxresult).
