Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxInputQueryValidationProc Type

The procedural type for validation routines used in input query dialogs.

#Declaration

Delphi
TdxInputQueryValidationProc = reference to procedure(ValueIndex: Integer; const Value: string; var IsValid: Boolean);

#Parameters

Name Type Description
ValueIndex Integer

The index of the currently evaluated string.

Value string

The currently evaluated string.

IsValid Boolean

If False, the input dialog box disables the OK button and ignores the Enter keystroke. If True, the content of all displayed text editors is considered valid.

#Remarks

The following code example demonstrates a validation routine that disables the OK button and ignores the Enter keystroke if at least one of the displayed text editors is empty:

uses
  dxInputDialogs;  // This unit declares the dxInputQuery function
// ...

procedure TMyForm.ValidationProcedure(ValueIndex: Integer; const Value: string; var IsValid: Boolean);
begin
  if Value = '' then  // Disables the "OK" button if at least one editor value is an empty string
    IsValid := False;
end;

procedure TMyForm.cxButton1Click(Sender: TObject);
var
  APrompts, AValues: array of string;
begin
  SetLength(APrompts, 2);
  SetLength(AValues, 2);
  APrompts[0] := 'First Name:';
  APrompts[1] := 'Last Name';
  dxInputQuery('New User', APrompts, AValues, ValidationProcedure);
end;

#Direct TdxInputQueryValidationProc Procedural Type References

The following global methods accept a routine of the TdxInputQueryValidationProc type as the AValidationProc parameter:

dxInputQuery(string,string,string,TdxInputQueryValidationProc)
Displays a modal input dialog box that prompts a user to enter a string and checks if user input is valid.
dxInputQuery(string,string[],string[],TdxInputQueryValidationProc)
Invokes an input dialog box that allows users to enter a string.
dxSelectQuery(string,string,TStrings,string,Boolean,TdxInputQueryValidationProc)
Displays a modal input dialog box that allows users to select a value in a combo box.
See Also