TdxInputQueryValidationProc Type
The procedural type for validation routines used in input query dialogs.
Declaration
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 |
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:
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;
The following global methods accept a routine of the TdxInputQueryValidationProc type as the AValidationProc
parameter:
- dxInputQuery(string,string,string,TdxInputQueryValidationProc)
- dxInputQuery(string,string[],string[],TdxInputQueryValidationProc)
- dxSelectQuery(string,string,TStrings,string,Boolean,TdxInputQueryValidationProc)
See Also