# TextViewGenerator.GetDialogBox Method

> Returns a view generator for the specified built-in dialog box.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 21.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > TextViewGenerator.GetDialogBox Method
- **1668 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/getdialogbox-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/getdialogbox-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/getdialogbox-method/llms-full.txt

---

### Description

Returns a view generator for the specified built-in dialog box.

### Syntax

#### GetDialogBox(TextViewGenerator.DialogBoxKind)

Returns a view generator for the specified built-in dialog box.

```csharp
public DialogViewGenerator GetDialogBox(TextViewGenerator.DialogBoxKind kind);
```

```vbnet
Public Function GetDialogBox(kind As TextViewGenerator.DialogBoxKind) As DialogViewGenerator
```

| Parameter | Description |
|---|---|
| kind | Specifies which kind of dialog box is represented through the view generator. It can be one of the values specified through the [DialogBoxKind](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/dialogboxkind-enumeration/llms-full.txt) enumeration. |

#### GetDialogBox(TextViewGenerator.DialogBoxKind, int)

Returns a view generator for the specified built-in dialog box and selects the specified dialog box tab.

```csharp
public DialogViewGenerator GetDialogBox(TextViewGenerator.DialogBoxKind kind, int selectedTab);
```

```vbnet
Public Function GetDialogBox(kind As TextViewGenerator.DialogBoxKind, selectedTab As Integer) As DialogViewGenerator
```

| Parameter | Description |
|---|---|
| kind | Specifies which kind of dialog box is represented through the view generator. It can be one of the values specified through the [DialogBoxKind](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/dialogboxkind-enumeration/llms-full.txt) enumeration. |
| selectedTab | Specifies an zero-based index indicating which dialog box tab is selected. This parameter can only be used for the following dialog boxes:  \| Dialog Box \| Possible Tabs \| \| ImageAttributesDialog \| Tab 0: Layout and position, tab 1: Size, scaling and distances, tab 2: Saving options. \| \| TextFrameAttributesDialog \| Tab 0: Layout and position, tab 1: Size, scaling and distances, tab 2: frame width and color. \| \| BarcodeLayoutDialog \| Tab 0: Layout and position, tab 1: Size, scaling and distances, tab 2: barcode options like type, text, rotation and colors. \| \| ChartLayoutDialog \| Tab 0: Layout and position, tab 1: Size, scaling and distances. \| \| DrawingLayoutDialog \| Tab 0: Layout and position, tab 1: Size, scaling and distances. \| \| TableFormatDialog \| Tab 0: Frame width and color, background color and text distances, tab 1: Cell height, vertical alignment and formatting options. \| \| ParagraphFormatDialog \| Tab 0: Alignment, text direction, indents and distances, tab 1: Frames and pagination. \| \| SectionFormatDialog \| Tab 0: Page size, orientation and page margins, tab 1: Defining headers and footers, tab 2: Attributes of page columns, tab 3: Attributes of page frames. \| |
|---|

#### GetDialogBox(PageNumberField)

Returns a view generator for a dialog box handling the attributes of the specified pagenumber field.

```csharp
public DialogViewGenerator GetDialogBox(PageNumberField pageNumberField);
```

```vbnet
Public Function GetDialogBox(pageNumberField As PageNumberField) As DialogViewGenerator
```

| Parameter | Description |
|---|---|
| pageNumberField | Specifies the [PageNumberField](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagenumberfield/llms-full.txt) for which the dialog box is opened. |

#### GetDialogBox(FormField)

Returns a view generator for a dialog box handling the attributes of the specified form field.

```csharp
public DialogViewGenerator GetDialogBox(FormField formField);
```

```vbnet
Public Function GetDialogBox(formField As FormField) As DialogViewGenerator
```

| Parameter | Description |
|---|---|
| formField | Specifies the [FormField](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/formfield/llms-full.txt) for which the dialog box is opened. |

### Return Value

The method returns a [DialogViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/llms-full.txt) object which can be used to manage and display a built-in dialog box. The return value is null, if a previously returned view generator has not yet been disposed.

### Examples

The following example applies bold formatting through the text view generator's selection by using `TextViewGenerator.GetDialogBox`.

```csharp
Selection formattedSelection = textViewGenerator.Selection;
formattedSelection.Bold = true;
textViewGenerator.Selection = formattedSelection;

var result = textViewGenerator.GetDialogBox(TXTextControl.ServerVisualisation.TextViewGenerator.DialogBoxKind.FontDialog, 10);
Console.WriteLine($"Get Dialog Box result: {result}");
```

```vbnet
Dim formattedSelection As Selection = textViewGenerator.Selection
formattedSelection.Bold = True
textViewGenerator.Selection = formattedSelection

Dim result = textViewGenerator.GetDialogBox(TXTextControl.ServerVisualisation.TextViewGenerator.DialogBoxKind.FontDialog, 10)
Console.WriteLine($"Get Dialog Box result: {result}")
```

---

## Nearby

- **Previous:** [TextViewGenerator.FrameSized Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/framesized-event/llms-full.txt)
- **Next:** [TextViewGenerator.HeaderFooterActivated Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/headerfooteractivated-event/llms-full.txt)
