Back to Devexpress

XtraInputBoxArgs.DefaultResponse Property

windowsforms-devexpress-dot-xtraeditors-dot-xtrainputboxargs-78a255a7.md

latest3.0 KB
Original Source

XtraInputBoxArgs.DefaultResponse Property

Gets or sets the default response for the dialog box.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public object DefaultResponse { get; set; }
vb
Public Property DefaultResponse As Object

Property Value

TypeDescription
Object

An Object that represent the default response.

|

Remarks

Use the DefaultResponse property to specify the default response for the dialog box.

The code snippet below shows how to display the dialog box using custom arguments.

csharp
// initialize a new XtraInputBoxArgs instance 
XtraInputBoxArgs args = new XtraInputBoxArgs();
// set required Input Box options 
args.Caption = "Shipping options";
args.Prompt = "Delivery date";
args.DefaultButtonIndex = 0;
// initialize a DateEdit editor with custom settings 
DateEdit editor = new DateEdit();
editor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI;
editor.Properties.Mask.EditMask = "MMMM d, yyyy";
args.Editor = editor;
// a default DateEdit value 
args.DefaultResponse = DateTime.Now.Date.AddDays(3);
// display an Input Box with the custom editor 
var result = XtraInputBox.Show(args).ToString();
vb
' initialize a new XtraInputBoxArgs instance 
Dim args As New XtraInputBoxArgs()
' set required Input Box options 
args.Caption = "Shipping options" 
args.Prompt = "Delivery date" 
args.DefaultButtonIndex = 0
' initialize a DateEdit editor with custom settings 
Dim editor As New DateEdit()
editor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI
editor.Properties.Mask.EditMask = "MMMM d, yyyy" 
args.Editor = editor
' a default DateEdit value 
args.DefaultResponse = Date.Now.Date.AddDays(3)
' display an Input Box with the custom editor 
Dim result = XtraInputBox.Show(args).ToString()

When an end-user clicks “OK” or “Yes”, the XtraInputBox.Show method returns an Object that is the editor’s edit value. Otherwise, the method returns null ( Nothing in VB).

See Also

Input Box

Editor

XtraInputBoxArgs Class

XtraInputBoxArgs Members

DevExpress.XtraEditors Namespace