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
 
 
 
 
 
 
TitleShow a form without activating it
Keywordsform, activate, show
CategoriesControls, API
 
Sometimes it is handy to display a form without activating it. For example, you can display extra information without removing the focus from the user's current form.

To do this, use the ShowWindow API function.

 
Private Sub cmdShowDetails_Click()
    ' Position the detail form under the main form.
    Form2.Move Form1.Left, Form1.Top + Form1.Height, _
        Form1.Width

    ShowWindow Form2.hwnd, SW_SHOWNOACTIVATE
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated