windowsforms-devexpress-dot-xtraeditors-dot-xtrainputbox-dot-show-1-x28-devexpress-dot-xtraeditors-dot-xtrainputboxargs-x29.md
Displays an input box with the specified settings.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public static T? Show<T>(
XtraInputBoxArgs args
)
where T : struct
Public Shared Function Show(Of T As Structure)(
args As XtraInputBoxArgs
) As T?
| Name | Type | Description |
|---|---|---|
| args | XtraInputBoxArgs |
An object that specifies the input box settings.
|
| Name | Description |
|---|---|
| T |
The returned value’s type.
|
| Type | Description |
|---|---|
| Nullable<T> |
The value entered by a user, or null (Nothing in VB.NET) if nothing was entered.
|
The following code snippet displays a dialog box with default settings:
using DevExpress.XtraEditors;
// Display an input box with the specified prompt, title, and default response.
XtraInputBox.Show("Enter a new value", "Change Settings", "Default");
// Display an input box with the specified owner, prompt, title, and default response.
XtraInputBox.Show(this, "Enter a new value", "Change Settings", "Default");
Imports DevExpress.XtraEditors
' Display an input box with the specified owner, prompt, title, and default response.
XtraInputBox.Show("Enter a new value", "Change Settings", "Default")
' Display an input box with the specified owner, prompt, title, and default response.
XtraInputBox.Show(Me, "Enter a new value", "Change Settings", "Default")
The following code snippet displays an input box with the specified text, caption, and editor:
using DevExpress.XtraEditors;
// Create a DateEdit and customize its settings.
DateEdit dateEditor = new DateEdit();
dateEditor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI;
dateEditor.Properties.Mask.EditMask = "MMMM d, yyyy";
// Initialize a new XtraInputBoxArgs instance with the specified settings.
XtraInputBoxArgs args = new XtraInputBoxArgs()
{
Caption = "Shipping Options",
Prompt = "Delivery Date",
DefaultButtonIndex = 0,
Editor = dateEditor,
DefaultResponse = DateTime.Now.Date.AddDays(3) // The date editor's default value
};
// Display the input box and assign the dialog result to a variable.
var result = XtraInputBox.Show(args);
Imports DevExpress.XtraEditors
' Create a DateEdit and customize its settings.
Dim dateEditor As New DateEdit()
dateEditor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI
dateEditor.Properties.Mask.EditMask = "MMMM d, yyyy"
' Initialize a new XtraInputBoxArgs instance with the specified settings.
Dim args As New XtraInputBoxArgs() With {
.Caption = "Shipping Options",
.Prompt = "Delivery Date",
.DefaultButtonIndex = 0,
.Editor = dateEditor,
.DefaultResponse = DateTime.Now.Date.AddDays(3) ' The date editor's default value
}
' Display the input box and assign the dialog result to a variable.
Dim result = XtraInputBox.Show(args)
See Also