菜鸟提个问题(100)

  • 主题发起人 紫竹林23424
  • 开始时间

紫竹林23424

Unregistered / Unconfirmed
GUEST, unregistred user!
我要实现这样一个功能 下拉列表框有1到20个数,比如我按2,信息框返回18, 按7,返回13, 按19,返回1,如果按20,返回0,代码怎么写呢
 
form接收输入,判断输入为数字,则进行(20-输入)处理
 
在下拉列表的OnKeyPress事件写入 判断#2 #7等 就将ComBox.text = 18...
 
在下拉列表的OnKeyPress事件写入 case combobox1.itemindex of0:begin.... combobox1.text:=xxx;end;1:begin.... combobox1.text:=xxx;end;.....20:begin.... combobox1.text:=xxx;end;
 
procedure TForm1.combobox1Select(Sender: TObject);edit1.text:=inttostr(20-combobox1.itemindex-1);end;
 

Similar threads

S
回复
0
查看
953
SUNSTONE的Delphi笔记
S
S
回复
0
查看
775
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
顶部