# 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

### ![](/files/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [String](https://docs.microsoft.com/dotnet/api/system.string) | Optional. Custom audio stream. If omitted the default beep wav is played. |

### ![](/files/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf)           | [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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)            | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)            | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)   | [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.

### ![](/files/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf)           | [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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)            | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)            | [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.

### ![](/files/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf)       | [MsgBoxStyle](/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxstyle.md) | 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** ![](/files/1vGqtbG2j637vQ4ROWOf)         | [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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [Action\<MsgBoxResult>](https://docs.microsoft.com/dotnet/api/system.action-1)            | Optional. Asynchronous callback.                                                                                                                                                                                                                                |

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

### ![](/files/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [MsgBoxStyle](/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxstyle.md) | 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** ![](/files/1vGqtbG2j637vQ4ROWOf)   | [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](/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.msgboxresult.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web.visualbasic/extensions/wisej.web.visualbasic.interaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
