(1)在窗口中建立实例变量
boolean ib_change = false
(2)建立一个事件:ue_changing() Event Id 为 pbm_enchange
代码如下
if not ib_change then
ib_change = true
int i
int li_pos
string lsdata
li_pos = selectedstart( )
for i=1 to len(text)
if not Match( mid(text,i,1) , "[0-9]") then
li_pos --
continue
end if
lsdata+=mid(text,i,1)
next
text = lsdata
this.selecttext(li_pos,0)
ib_change = false
end if
(3)试试效果吧
本文介绍了一个用于文本处理的事件:ue_changing()。该事件通过遍历文本中的每个字符并检查其是否为数字来筛选文本内容。非数字字符将被移除,而数字字符则被保留,最终更新文本内容。
2631

被折叠的 条评论
为什么被折叠?



