Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Collapse]Messages, Notifications and Dialogs
    XtraMessageBox
    Input Box
    XtraDialog
    Flyout Dialog
    Flyout Panel
   [Expand]Alert Windows
    Toast Notification Manager
    WinRTLiveTileManager
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.
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.

How would you rate this topic?​​​​​​​