有没有一种方法按钮时,pressed砸下来一个TJvComboEdit的自动完成列表? [英] Is there a way to drop down a TJvComboEdit's AutoComplete list when the button is pressed?

查看:206
本文介绍了有没有一种方法按钮时,pressed砸下来一个TJvComboEdit的自动完成列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有上有一个TJvComboEdit控制(从绝地可视组件库,JVCL)的形式。这种控制已经得到了一个AutoCompleteList,如果我设置为AutoCompleteOptions我acoUpDownKeyDropsList可以在运行时显示该列表由pressing向上或向下键。

I have got a form with a TJvComboEdit control (from Jedi Visual Components library, jvcl) on it. This control has got an AutoCompleteList and if I set AutoCompleteOptions to acoUpDownKeyDropsList I can at runtime show this list by pressing the up or down key.

到目前为止,这很好,但除了我想要控制的按钮,也显示该列表(如TComboBox按钮的),但我找不到任何方式做到这一点。列表中的表现似乎是由一些内部IAutoComplete Windows界面不公开的API用于显示列表来完成。

So far, that's fine, but in addition to that I want the control's button to also show that list (like a TComboBox button does) but I can not find any way to do that. The showing of the list seems to be done by some internal IAutoComplete Windows interface which does not expose an api for showing the list.

我缺少的东西吗?或者有没有其他的控制,我可以用呢? (除了明显的TComboBox)?

Am I missing something? Or is there any other control I could use instead? (apart from the obvious TComboBox)?

推荐答案

TJvComboEdit 使用的 IAutoComplete 和的 IAutoComplete2 接口,没有办法手动调用下拉列表他们。

The TJvComboEdit uses the IAutoComplete and IAutoComplete2 interfaces for autocomplete features and there is no way to invoke the drop down list for them manually.

您可以使用下面的技巧而将焦点设置到 TJvComboEdit 并模拟<大骨节病>↓键。

You can use the following hack which sets the focus to the TJvComboEdit and simulate the key.

procedure TForm1.Button1Click(Sender: TObject);
begin
  if JvComboEdit1.CanFocus then
  begin
    JvComboEdit1.SetFocus;
    keybd_event(VK_DOWN, 0, 0, 0);
    keybd_event(VK_DOWN, 0, KEYEVENTF_KEYUP, 0);
  end;
end;

这篇关于有没有一种方法按钮时,pressed砸下来一个TJvComboEdit的自动完成列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆