菜鸟提问:MaskEdit的具体使用方法?

kshan 2002-01-14 11:07:28
加精
...全文
381 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
fenglingdu 2002-01-18
  • 打赏
  • 举报
回复
新手学习。。。
fiveyes 2002-01-16
  • 打赏
  • 举报
回复
如果“!”出现在屏蔽字符串中,则前导空格不被计入有效字符串中;如果屏蔽字符串不不含“!”,则后缀的空格不被计入有效字符串中。
所有跟在“>”后的字符都将被转换成大写,直到字符串结尾或遇到“<”。
所有跟在“<”后的字符都将被转换成小写,直到字符串结尾或遇到“>”。
<>对用户输入的字符不作任何转换,保持其原来的大小写格式。
\之后的字符被视为普通字符,在需要将屏蔽格式字符作为普通字符使用时,使用“\”加此字符。
L要求在此位置输入字母字符。
l(小写L哟)在此位置仅能输入字母,也可以空缺。
A在此位置必须输入字母或数字字符,即A-Z,a-z,0-9。
a在此位置仅能输入字母或数字字符,也可以空缺。
C在此位置上必须输入字母。
c在此位置上只能输入字母,也可以空缺。
0在此位置上必须输入数字。
9在此位置上只能输入数字,也可以空缺。
#在此位置上只能输入数字或正负号,也可以空缺。
/通常用来分隔年、月、日。
;用来分隔屏蔽串中的三部分。
_(下划线哟)在此位置自动插入一个空格,输入时光标会自动跳过此空格到下一个输入位置。
fiveyes 2002-01-16
  • 打赏
  • 举报
回复
例如:将EditMask设置为:!\(999\)000-0000;l;_
第一个分号左侧为屏蔽串本身,它来限定文本格式;
第一个分号和第二个分号之间的1表示屏蔽串也将被存为输入数据的一部分。
末尾的"_"表示以“_”代表未空缺字符。
在未输入字符时,EditMask中将显示:(___)___-____。
fiveyes 2002-01-15
  • 打赏
  • 举报
回复
抄书的又来了:
设定屏蔽格式:
相关属性:EditMask。该属性中记录有文本格式字符串,MaskEdit对象会根据该属性中设定的文本格式串来过滤用户输入的字符,只有合法的输入字符才被接受,非法字符将被屏蔽掉。
一个屏蔽(Mask)由三部分组成,相互之间用分号(;)分开,这三部分分别是:
第一部分为屏蔽本身。
第二部分用来决定是否将屏蔽字符也存为数据的一部分,0表示不保存;1表示保存。
第三部分用来说明以什么字符来代替屏蔽中的未输入字符。
待续
kshan 2002-01-15
  • 打赏
  • 举报
回复
可是对于一个站在MaskEdit门槛的人就是难了.Help!
belief888 2002-01-15
  • 打赏
  • 举报
回复
不难的
foxwizard 2002-01-15
  • 打赏
  • 举报
回复

MSDN文档的VB部分应当是有中文版的,
你再找找吧

kshan 2002-01-15
  • 打赏
  • 举报
回复
有哪位兄弟可以简单地翻译一下上楼hotxu()关于MaskEdit用法?
ITBUG 2002-01-15
  • 打赏
  • 举报
回复
定义格式后为什么MaskEdit框里会出现下划线的,不要它可以的吗?

用<--Backspace 删除,再按‘空格’键,下划线就被空格代替。
tokens 2002-01-15
  • 打赏
  • 举报
回复
下划线去掉很容易呀,
好象是在EditMask框里设置的,
在左边,在输入mask的下面,好象是第2 个框吧,把里面的_改成 (这里是空格)就可以了。
你看看就知道了,我办公室里的机器没装CBUILDER,看不到,不能说更多,但印象中就这样了。
唉,办公室的硬盘太小了,删了帮助,还不够盘,只好~~~~~
hotxu 2002-01-15
  • 打赏
  • 举报
回复
下划线我也不知道如何去掉,你觉得不好用可以自己做一个。
kshan 2002-01-15
  • 打赏
  • 举报
回复
E文不好,不过会好好研究一下的了.定义格式后为什么MaskEdit框里会出现下划线的,不要它可以的吗?
hotxu 2002-01-15
  • 打赏
  • 举报
回复
“ 9”代表只能输入0-9的数字,其他的见下。
Character Meaning in mask

! If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.
> If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.
< If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<> If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.
\ The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal in the data.
L The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.
l The l character permits only an alphabetic character in this position, but doesn't require it.

A The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.
a The a character permits an alphanumeric character in this position, but doesn't require it.
C The C character requires an arbitrary character in this position.
c The c character permits an arbitrary character in this position, but doesn't require it.
0 The 0 character requires a numeric character only in this position.
9 The 9 character permits a numeric character in this position, but doesn't require it.

# The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.
: The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.
/ The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

; The ; character is used to separate the three fields of the mask.
_ The _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.
kshan 2002-01-15
  • 打赏
  • 举报
回复
to hotxu()
我不明白设置InputMask为!\(9999\)0000000;1;_是为什么意思?
我就是不明白怎样自定义格式呀!比如上面的这个,9999代表什么,为什么不是8而是9.
rh 2002-01-14
  • 打赏
  • 举报
回复
这里推崇实践
hotxu 2002-01-14
  • 打赏
  • 举报
回复
你还可以在InputMask属性里根据系统提供的格式设计你想要的格式。
hotxu 2002-01-14
  • 打赏
  • 举报
回复
MaskEdit和Edit类似不过MaskEdit可以以格式化限制用户输入,要改变格式
你需要改变InputMask属性:
如你想让用户输入类似于(0532)1234567格式
设置InputMask为!\(9999\)0000000;1;_
kshan 2002-01-14
  • 打赏
  • 举报
回复
刚才用金山快译看了一下,除了不懂还是不懂.
你们可以说明一下吗?这样一样可以出真知!
可以少走弯路,谢谢你们。
zdb1025 2002-01-14
  • 打赏
  • 举报
回复
那你就在《金山词霸》的帮助下亲自动手试试
反正一般不会发生什么致命的错误
实践出真知!
kshan 2002-01-14
  • 打赏
  • 举报
回复
我的E文不好呀!
加载更多回复(1)

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧