if (key = 38) and (ComboBox1.ItemIndex = 0)then//key=38是按向上键
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
if (key = 40) and (ComboBox1.ItemIndex = ComboBox1.Items.Count-1)then
//key=40是按向下键
ComboBox1.ItemIndex := 0;
我在ComboBox1的keydown中实现
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
if (key = 40) and (ComboBox1.ItemIndex = ComboBox1.Items.Count-1)then
//key=40是按向下键
ComboBox1.ItemIndex := 0;
我在ComboBox1的keydown中实现
解决方案 »
- delphi基础问题
- 语法求教
- 元旦快到了,散分,顺便说说论坛里的一些事
- 请高手帮忙,如何获取网络上共享文件夹对某一用户的权限的设定。
- webbrowser能不能用opera打开?
- 我现在想把4段wav声音文件连起来播放怎么办啊
- 毕业设计 课题是分布式售票管理系统 请大家提供思路!非常谢谢大家!!
- 关于在ClientDataSet中利用Sql语句查询来自XML文件的数据问题!
- 为什么在DLL中使用pchar(s)出错?
- 浏览某些网站后会利用IE的漏洞使浏览器的地址栏变灰,不能修改,这是在注册表中什么地方做的啊?//瑶瑶
- 如何做这个报表
- 请问用html help workshop制作的chm文档怎么显示不了图片?
Shift: TShiftState);
begin
if (key = 38) and (ComboBox1.ItemIndex = 0)then//key=38是按向上键
begin
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
Key := 0;
end;
if (key = 40) and (ComboBox1.ItemIndex = ComboBox1.Items.Count-1)then
begin //key=40是按向下键
ComboBox1.ItemIndex := 0;
Key := 0;
end;
end;
procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = VK_UP) and (ComboBox1.ItemIndex = 0)then//VK_UP是按向上键
begin
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
Key := 0;
end;
if (Key = VK_DOWN) and (ComboBox1.ItemIndex = ComboBox1.Items.Count-1)then
begin //VK_DOWN是按向下键
ComboBox1.ItemIndex := 0;
Key := 0;
end;
end;
begin
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
Key := 0;
end下面的也是
Shift: TShiftState);
begin
if(Key=VK_DOWN)and (ComboBox1.ItemIndex = ComboBox1.Items.Count-1) then
begin
ComboBox1.ItemIndex:=0;
Key:=0;
end
else if (key =VK_UP) and (ComboBox1.ItemIndex = 0)then
begin
ComboBox1.ItemIndex := ComboBox1.Items.Count-1;
Key:=0;
end;end;通过,结帖吧~~收分啦~~^_^