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
 
 
 
 
 
TitleGive a window a toolbar style title bar
Keywordsform, toolbar, titlebar, SetWindowLong
CategoriesControls, API
 
Use the SetWindowLong API function to set the form's WS_EX_TOOLWINDOW style, making it use a small title bar. Then use SetWindowPos to make the form redraw itself with the new frame style.
 
Private Sub Form_Load()
Dim styles As Long

    ' Set the WS_EX_TOOLWINDOW style
    styles = GetWindowLong(hwnd, GWL_EXSTYLE)
    styles = SetWindowLong(hwnd, GWL_EXSTYLE, _
        styles Or WS_EX_TOOLWINDOW)

    ' Make the form redraw itself to update its frame.
    SetWindowPos hwnd, 0, 0, 0, 0, 0, _
        SWP_FRAMECHANGED Or SWP_NOMOVE Or _
        SWP_NOZORDER Or SWP_NOSIZE
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated