一个比较头痛的问题 edit1 onchange事件中写一个case Edit1.text do'1':button1.setfocus;(可能你这里是要调用button1的click事件).... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);beginif key='1' then button1.SetFocus;end; 你可以通过设置一组相应控件的TAG属性来实现这一功能。首先在窗体中放置5个BUTTON控件,然后分别设置这三个控件的TAG属性为1、2、3、4、5。接下来在edit1的某个事件里输入如下代码:procedure TForm1.*******(Sender:TObject);varcap:string;begincaseTButton(sender).Tagof1:button1.enable=true;2:button2.enable=true;3:button3.enable=true;end;end;这样一来就可以实现你要的功能了。 错了,我以为做控件数组呢,wljcr(不要了吧?) 和cygnet2001(小丸子) 说的都对! procedure TForm1.Edit1Change(Sender: TObject);begincase strtoint(edit1.Text) of1:button1.SetFocus;2:button2.SetFocus;3:button3.SetFocus;4:button4.SetFocus;5:button5.SetFocus;elseshowmessage('hello');end;end; 穿透路由器.控制内网机器的问题.在线等... 急干求(时间查询SQL语句) c/s编程的经验问题? Delphi 中﹐如果指定dbgrid 的某个field 得到焦点啊…… 各位谁知道哪里有VCL组件参考大全下载吗? 怎么解决标签闪的问题? 关于dbgrid的问题?? delphi中怎样写返回语句,它没有return关键字? 很奇怪的问题! 一个极其简单的问题,附代码 关于Interbase日期查询问题,高手请进 帮帮我吧,为什么用PrintDialog选择打印机后打印出来仍旧在默认的打印上?
begin
if key='1' then button1.SetFocus;
end;
procedure TForm1.*******(Sender:TObject);
varcap:string;
begin
caseTButton(sender).Tagof
1:button1.enable=true;
2:button2.enable=true;
3:button3.enable=true;
end;
end;
这样一来就可以实现你要的功能了。
begin
case strtoint(edit1.Text) of
1:button1.SetFocus;
2:button2.SetFocus;
3:button3.SetFocus;
4:button4.SetFocus;
5:button5.SetFocus;
else
showmessage('hello');
end;
end;