Results 1 to 5 of 5

Thread: Hiding the border???

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Question Hiding the border???

    I once heard the you could strip away the border and keep the controls, How?

    I mean remove the form border and keep the use of the border controls to right click on the icon in the tastbar...

    Restore
    Move
    Size
    Minimize
    Maximize
    -------------
    Close
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  2. #2
    Hyperactive Member IntelSucks's Avatar
    Join Date
    Oct 2003
    Location
    Ubuntu Lovers Club
    Posts
    453
    wait...completely remove the border and have controls just floating? Or having no border or controls at all?

  3. #3
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    See if this is what you are after.
    VB Code:
    1. Option Explicit
    2.  
    3. 'API Calls Used To Remove The Title Bar From Window (Make A Sizeable Borderless Form)
    4. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    5.                             (ByVal hwnd As Long, ByVal nIndex As Long, _
    6.                             ByVal dwNewLong As Long) As Long
    7. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
    8.                             (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    9.                            
    10. Private Const GWL_STYLE = (-16)
    11. Private Const WS_DLGFRAME = &H400000
    12.  
    13. 'API Calls Used To Move A Form With The Mouse
    14. Private Declare Function ReleaseCapture Lib "user32" () As Long
    15. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    16.                             (ByVal hwnd As Long, ByVal wMsg As Long, _
    17.                             ByVal wParam As Long, lParam As Any) As Long
    18.  
    19. Private Const HTCAPTION = 2
    20. Private Const WM_NCLBUTTONDOWN = &HA1
    21.  
    22. Private Sub Form_Load()
    23.     'ERASE the Title Bar
    24.     SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) + WS_DLGFRAME
    25. End Sub
    26.  
    27. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    28.     'Move the form with the Left Mouse Button
    29.     If Button = vbLeftButton Then
    30.         Me.MousePointer = vbSizeAll
    31.         Call ReleaseCapture
    32.         Call SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
    33.         Me.MousePointer = vbArrow
    34.     End If
    35. End Sub

  4. #4
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Yeah, he means the Control Box

  5. #5

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    Thanks MarkT,

    That was the exact thing I was looking for...
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width