简体   繁体   English

VB6组合框事件

[英]VB6 Combo box events

I have a form in VB6 with two combo boxes (cboCustomer and cboItemNumber). 我在VB6中有一个带有两个组合框(cboCustomer和cboItemNumber)的表单。 When someone selects a value from cboCustomer, I want to populate cboItemNumber with a list of item numbers relevent to the customer selected. 当有人从cboCustomer中选择一个值时,我想填充cboItemNumber,其中包含与所选客户相关的项目编号列表。 What event does VB6 offer that I can use? 我可以使用VB6提供什么事件? I've tried _Change and _LostFocus and neither are doing what I need. 我已经尝试了_Change和_LostFocus,而且我都没有做我需要的事情。 I find it hard to believe that I'm having such a difficult time finding a list of possible events. 我发现很难相信我很难找到可能发生的事件清单。

Try the _Click event. 尝试_Click事件。 This event fires even if the control is't actually clicked on. 即使未实际点击控件,此事件也会触发。 For example, if you tab in to it and use the up/down arrow keys to change the selected item, the click event still fires. 例如,如果您选中它并使用向上/向下箭头键更改所选项目,则单击事件仍会触发。

As G Mastros says, the _Click event is the one to use, since it fires when the selection is changed via either keyboard or mouse. 正如G Mastros所说,_Click事件是要使用的事件,因为当通过键盘或鼠标更改选择时它会触发。

If you want to see a list of all the events, then use the Object Browser (F2), and search for or browse to ComboBox. 如果要查看所有事件的列表,请使用对象浏览器(F2),然后搜索或浏览到ComboBox。 Events are shown with yellow lightning bolts in the Members pane. 会员窗格中的事件显示为黄色闪电。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM