1、引用单元dxInputDialogs
2、方法dxInputQuery(string,string,string,TdxInputQueryValidationProc)
定义:
function dxInputQuery(const ACaption: string; const APrompt: string; var AValue: string; AValidationProc: TdxInputQueryValidationProc): Boolean;
参数:
名称 | 类型 | 说明 |
ACaption | 标题 | |
APrompt | 文本提示 | |
AValue | 点击确认按钮,返回编辑框的值 | |
AValidationProc | 验证输入值是否有效 |
返回:Boolean,点击确认键返回True,取消键返回False
3、示例
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 AUserInput: string; begin // ... dxInputQuery('Rename', 'New Name:', AUserInput, ValidationProcedure); // ... end;
验证通过后,确认键可用。
标签:返回,const,string,对话框,DevExpress,dxInputQuery,Boolean,var,输入 From: https://www.cnblogs.com/bigcat0001/p/17405546.html