Announcement

Collapse
No announcement yet.

vb.net remove border from application?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • vb.net remove border from application?

    Hi, I am working on embedding outside applications into my project and so far I have everything working except for being able to remove the border around the application. Does anyone have any code that will work for this? I am using VB.NET VS2008.

    Thanks for the help!

  • #2
    You can search MSDN for "Window Styles" (link) to learn more about how to set the styles of an embedded window. Here is the list of options I use when calling the SetWindowLong( ) API (link):

    Code:
    Public Enum e_WindowStyle
            WS_BORDER = &H800000 ' thin border
            WS_CAPTION = &HC00000 ' has title bar
            WS_CHILD = &H40000000 ' child window style...  does not allow menu
            WS_DISABLED = &H8000000 ' disabled
            WS_HSCROLL = &H100000 ' has horizontal scroll
            WS_VSCROLL = &H200000 ' has vertical scroll
            WS_THICKFRAME = &H40000 ' thick frame
            WS_VISIBLE = &H10000000 ' initially visible
            WS_TABSTOP = &H10000 ' tabstop
        End Enum
    When you call the SetWindowLong( hWnd, nIndex, dwNewLong ) API, you will add the above values together for the look you want. They are passed as the dwNewLong value, and the nIndex is set to -16 (GWL_STYLE... aka new Window Style). I personally prefer to use WS_TABSTOP + WS_VISIBLE + WS_CHILD. WS_VISIBLE if nothing else, just to ensure it's visible. WS_TABSTOP, just to ensure tab-stopping. And WS_CHILD to get rid of the menus. However, if you need the menus, then do not add in WS_CHILD.

    Let me know if you're interested in seeing more code/objects on the topic.
    Play with it, 'til it's broke.

    Comment

    Working...
    X