如果只包含空格,有没有办法禁止用户输入?我已经尝试过这个解决方案:
Inno Setup - Create User Input Query Page with input length and format limit and use the input
但是,我不想要该解决方案,因为它完全禁用 -space-。
例如,如果文本字段中的输入是“我的名字”,它将返回错误,因为 -space- 是不允许的。
使用与以下相同的代码:
Inno Setup - Create User Input Query Page with input length and format limit and use the input
只需使用以下实现ValidateInput
:
function ValidateInput(Sender: TWizardPage): Boolean;
begin
Result := True;
if Trim(Page.Values[0]) = '' then
begin
MsgBox('Input cannot be empty.', mbError, MB_OK);
Result := False;
end;
end;
该Trim
功能是关键。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句