Show / Hide Table of Contents

# Class Dialog

The dialog box is a window that by default is centered and contains one or more buttons. It defaults to the Colors.Dialog color scheme and has a 1 cell padding around the edges.

##### Inheritance

System.Object
Responder
View
Toplevel
Window
Dialog
FileDialog

##### Inherited Members

Toplevel.CanFocus
Toplevel.Create()
Toplevel.Running
Toplevel.WillPresent()
View.Add(View[])
View.AddRune(Int32, Int32, Rune)
View.Bounds
View.ChildNeedsDisplay()
View.Clear()
View.Clear(Rect)
View.ClearNeedsDisplay()
View.ClipToBounds()
View.ColorScheme
View.DrawFrame(Rect, Int32, Boolean)
View.DrawHotString(ustring, Boolean, ColorScheme)
View.DrawHotString(ustring, Attribute, Attribute)
View.Driver
View.EnsureFocus()
View.Focused
View.FocusFirst()
View.FocusLast()
View.FocusNext()
View.FocusPrev()
View.Frame
View.HasFocus
View.Height
View.Id
View.LayoutStyle
View.MostFocused
View.Move(Int32, Int32)
View.PositionCursor()
View.ProcessColdKey(KeyEvent)
View.ProcessHotKey(KeyEvent)
View.ScreenToView(Int32, Int32)
View.SetClip(Rect)
View.SetFocus(View)
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.Subviews
View.SuperView
View.ToString()
View.WantMousePositionReports
View.Width
View.X
View.Y
Window.Add(View)
Window.GetEnumerator()
Window.MouseEvent(MouseEvent)
Window.Redraw(Rect)
Window.Remove(View)
Window.RemoveAll()
Window.Title

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class Dialog : Terminal.Gui.Window

##### Remarks

To run the dialog modally, create the Dialog, and pass this to Application.Run which will execute the dialog until it terminates via the [ESC] key, or when one of the views or buttons added to the dialog set the Running property on the Dialog to false.

### Constructors

#### Dialog(ustring, Int32, Int32, Button[])

Initializes a new instance of the Dialog class with an optional set of buttons to display

##### Declaration

    public Dialog (NStack.ustring title, int width, int height, Terminal.Gui.Button[] buttons);

##### Parameters

Type | Name | Description
--- | --- | ---
NStack.ustring | title | Title for the dialog.
System.Int32 | width | Width for the dialog.
System.Int32 | height | Height for the dialog.
Button[] | buttons | Optional buttons to lay out at the bottom of the dialog.

### Methods

#### AddButton(Button)

Adds a button to the dialog, its layout will be controled by the dialog

##### Declaration

    public void AddButton (Terminal.Gui.Button button);

##### Parameters

Type | Name | Description
--- | --- | ---
Button | button | Button to add.

#### LayoutSubviews()

##### Declaration

    public override void LayoutSubviews ();

#### ProcessKey(KeyEvent)

##### Declaration

    public override bool ProcessKey (Terminal.Gui.KeyEvent kb);

##### Parameters

Type | Name | Description
--- | --- | ---
KeyEvent | kb | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.