TMaskEdit 的 EditMask 特性可以控制字符的输入, 或则在它的 OnKeyPress 实践中写代码: //只允许字母输入 if not ((Key in ['A'..'Z']) or (Key in ['a'..'z'])) then Key := #0;取字符串长度:Length(MaskEdit1.Text)
TMaskEdit 的 EditMask 特性可以控制字符的输入, 或则在它的 OnKeyPress 事件中写代码: //只允许字母输入 if not ((Key in ['A'..'Z']) or (Key in ['a'..'z'])) then Key := #0;取字符串长度:Length(MaskEdit1.Text)
得到MaskEdit的字符串长度和从Edit中得到一样
i:= Length(MaskEdit1.Text);
或则在它的 OnKeyPress 实践中写代码:
//只允许字母输入
if not ((Key in ['A'..'Z']) or (Key in ['a'..'z'])) then Key := #0;取字符串长度:Length(MaskEdit1.Text)
或则在它的 OnKeyPress 事件中写代码:
//只允许字母输入
if not ((Key in ['A'..'Z']) or (Key in ['a'..'z'])) then Key := #0;取字符串长度:Length(MaskEdit1.Text)
得到MaskEdit的字符串长度和从Edit中得到一样
i:= Length(MaskEdit1.Text);