inno-setup - 禁止在 Inno Setup 自定义页面上输入空白和仅空格
问题描述
如果它只包含空格,有没有办法禁止用户输入?我已经尝试过这个解决方案:
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
功能是关键。
推荐阅读
- arcgis-js-api - 在 arcgis api javascript 中单击时缩放到点簇
- c# - FileStream 可以打开并主要显示文件吗?
- spring-boot - Spring Boot 2.5.3 OAuth2 - Auth-Server 和 Webservice 分开,登录错误
- r - R plotly():带有条件内容的悬停模板
- terraform - 修剪地形中最后匹配的行
- paypal - Paypal 付款执行交易被拒绝
- aws-media-convert - 哪个输入/输出组设置会更改 HLS 的 EXTINF?
- blender - Blender 显示纯色而不是纹理
- python - Python中的Matlab结构/单元格/单元格数组(不同大小的矩阵)
- azure-logic-apps - 是否有任何 Terraform 代码或 ARM 模板代码可用于在 azure 中将操作作为逻辑应用程序创建操作组