如何上EDIT框里只能输入“M”和“F”啊? if not (Key in ['M','F']) then Key:=#0;这样不成,为什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 key:word;是个整数的if KEY=77 or Key=77 then Key:=#0; 怎么不成,这样可以,如果要小写也可以,就设置edit的charcase属性。修改一下集合就行了。 是不是你写代码的事件不对,试试下面的,我试过了,可以procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if (key<>'M') and (key<>'F') then key:=#0;end; if not (Key in ['M','F']) then //这样写输入M或是F全不没用。 Key:=#0; if KEY=77 or Key=77 then //是什么意思? 可以的你要在ONKEYPRESS事件里呀!!!! procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if not ((key='F') or (key='M')) then key:=#0;end; 虚拟打印机的问题 谁有支持 vclskin4.42的skin builder?给我一份啊? 打印文档到文件 怎样实现关闭系统 关于dbchart的问题 客户端如何使数据库服务器动态创建表和插入字段?????????????? 如何判断一个数据库是SQL Server数据库 TdbChart怎么画数据库的图啊,问什么总是之画一个数据呢?在线等待,立刻给分! 高分求答:如何控制dbgrid Paradox数据库不能保存 求助 表和视图的区别?
key:word;是个整数的
if KEY=77 or Key=77 then
Key:=#0;
edit的charcase属性。修改一下集合就行了。
begin
if (key<>'M') and (key<>'F') then
key:=#0;
end;
Key:=#0; if KEY=77 or Key=77 then //是什么意思?
你要在ONKEYPRESS事件里呀!!!!
begin
if not ((key='F') or (key='M')) then
key:=#0;
end;