PRB: LostFocus of Textbox Control Has Different Behavior
Article ID: 185238
Article Last Modified on 6/29/2004
APPLIES TO
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 4.0 Enterprise Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q185238
SYMPTOMS
In Visual Basic version 4.0, when a TextBox control has focus and a toolbar
is clicked, the LostFocus event of the TextBox is executed. Visual Basic
5.0 and later does not behave the same way and the LostFocus event is not
executed.
RESOLUTION
The toolbar is behaving similar to a menu, which is more appropriate.
Do not use a toolbar, in Visual Basic version 5.0, if you want the
LostFocus event of the TextBox control executed when the toolbar is
clicked.
Instead, have a CommandButton control on the form if executing LostFocus is
important to the applications design.
STATUS
This behavior is by design.
Additional query words: text box tool bar kbVBp400 kbVBp500 kbVBp600 kbdse kbDSupport kbVBp kbCtrl
Keywords: kbprb KB185238