Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleKeep track of the last control to have the focus
Keywordsfocus
CategoriesControls
 
In each control's GotFocus event handler, save the current and last controls to have focus.
 
Private Sub Text2_GotFocus()
    Set LastControl = CurrentControl
    Set CurrentControl = Text2

    ShowControls
End Sub
 
Alternatively you could save each control's name in its LostFocus event handler.

See also Keep track of the last control to have the focus before a button is pressed.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated