BUG: Setting ComboBox Control Text in Click Event Wipes Out TextLast reviewed: June 2, 1997Article ID: Q168824 |
The information in this article applies to:
SYMPTOMSWhen setting the ComboBox control Text property in the Click event of ComboBox control, the text always returns blank. This is different behavior than Visual Basic 3.0 and Visual Basic 4.0.
RESOLUTIONInstead of setting the Text property of the ComboBox control in the Click event, do it at the LostFocus event by shifting the focus to another control, such as TextBox, although it will leave the focus set to the TextBox. To work around that, hide a TextBox behind the ComboBox with TabStop property set to False; in the GotFocus event of the Textbox, set the focus back to the ComboBox. To place a TextBox behind the ComboBox in design time, choose the Send To Back menu command from the Format/Order menu; in runtime, set the z-order of TextBox to 1. The following code example shows how to keep the text of ComboBox control after being set at the Click event:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
|
Keywords : PrgCtrls vb5all VBKBCtrl VBKBInt VBKBStd
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |