dxSelectQuery(string,string,TStrings,string,Boolean,TdxInputQueryValidationProc) Method
Displays a modal input dialog box that allows users to select a value in a combo box.
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
ACaption | string | The caption of the displayed input dialog box. |
APrompt | string | The label for the displayed combo box. |
AValues | TStrings | The list of strings that correspond to the list of available choices. |
AValue | string | The selected value. |
AAllow |
Boolean |
|
AValidation |
Tdx |
The procedure that validates a value entered by a user. |
#Returns
Type | Description |
---|---|
Boolean |
|
#Remarks
Call the dxSelectQuery
function to display a simple input dialog box that prompts a user to choose one of the string values displayed in a combo box. The dialog imports all look & feel settings from the TdxSkinController component if it is in an application project. You can pass True
as the optional AAllowCustomValues
parameter to allow users to enter a custom string in addition to the options listed in the combo box. If you pass a validation routine as the optional AValidationProc
parameter, the displayed dialog box disables the OK button and ignores the Enter keystroke until a user enters or selects a valid value.
#Code Example: Display an Input Dialog with a Combo Box
uses
dxInputDialogs; // This unit declares the dxSelectQuery function
// ...
procedure TMyForm.cxButton1Click(Sender: TObject);
var
AUserInput: string;
AValues: TStringList;
begin
AValues := TStringList.Create;
try
AValues.Add('January');
AValues.Add('February');
AValues.Add('March');
AValues.Add('April');
AValues.Add('May');
AValues.Add('June');
AValues.Add('July');
AValues.Add('August');
AValues.Add('September');
AValues.Add('October');
AValues.Add('November');
AValues.Add('December');
dxSelectQuery('Choose Month', 'Month:', AValues, AUserInput);
finally
AValues.Free;
end;
end;