[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Collapse]Messages, Notifications, and Dialogs
    Input Box
    Flyout Dialog
    Flyout Panel
   [Expand]Alert Windows
    Toast Notification Manager
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Input Box

An XtraInputBox is a skinable dialog that displays one editor for end-users to set a desired value, and OK/Cancel buttons to confirm or reject this value. This dialog is a simplified version of the XtraDialog control with minimum customization options.

Input Boxes are created and customized entirely from code. To do that, call one of the XtraInputBox.Show methods.

Expanded Display an Input Box With a Default TextEdit Editor

To display an Input Box of this type, call the XtraInputBox.Show method overload with three string parameters.

Parameter Name Description
Prompt The text string above the editor.
Title The dialog caption.
DefaultResponce The default editor value, shown when the input box appears on screen.

The image and code below illustrate an example.

This XtraInputBox.Show method returns an editor value when an end-user clicks "OK". Otherwise, returns String.Empty.

Expanded Display an Input Box With a Custom Editor

To display an Input Box with any DevExpress editor within, call the XtraInputBox.Show method overload that takes an instance of the XtraInputBoxArgs class as a parameter. The XtraInputBoxArgs class exposes the following public properties.

Property Description
XtraInputBoxArgs.Editor The editor displayed by an Input Box
XtraInputBoxArgs.DefaultResponse The default editor value, shown when the input box appears on screen.
XtraInputBoxArgs.Prompt The text above the editor.
XtraInputBoxArgs.Showing This event allows you to access and customize a form within the dialog. For instance, you can set a dialog icon.
DefaultButtonIndex Specifies what Input Box button is a default one. When an end-user presses the Enter key, the default button is considered clicked. Set this property to 0 to make "OK" the default button, 1 for the "Cancel" button instead.
Caption The Input Box title.

At the following figure, an Input Box displays a DateEdit editor. The code below illustrates how to create such Input Box.

When an end-user clicks "OK", this XtraInputBox.Show method returns an Object that is the editor's edit value. Otherwise, the method returns null.

Is this topic helpful?​​​​​​​