Results 1 to 8 of 8

Thread: Is it not possible

  1. #1
    stickan
    Guest

    Is it not possible

    To have a PopUpMenu in a borderless form? It seems like a automaticaly get a border...

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    what do u mean ?
    -= a peet post =-

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    one way would be to have the menu on another form.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    stickan
    Guest

    Sorry...

    What I mean is that if I have a borderless form and then make a menu with Menu Editor and make it not visible I still get a border on the form even if no menu are showing.

  5. #5
    stickan
    Guest

    I have thought about that BuggyProgrammer.

    But do I really need another form to do this?

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    oh.. see what u mean... seems BuggyProgrammers found the way though

    VB Code:
    1. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.         PopupMenu Form1.mnuPopTest
    3. End Sub

    ....
    -= a peet post =-

  7. #7
    stickan
    Guest

    Ok

    It works and thats the main thing.

  8. #8
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Here is another option. This is adapted from something someone posted a while back. Sorry I don't know who to give credit to.
    VB Code:
    1. Option Explicit
    2. 'API Calls Used To Remove The Title Bar From Window (Make A Sizeable Borderless Form)
    3. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    4.                             (ByVal hwnd As Long, ByVal nIndex As Long, _
    5.                             ByVal dwNewLong As Long) As Long
    6. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
    7.                             (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    8.                            
    9. Private Const GWL_STYLE = (-16)
    10. Private Const WS_DLGFRAME = &H400000
    11.  
    12. 'API Calls Used To Move A Form With The Mouse
    13. Private Declare Function ReleaseCapture Lib "user32" () As Long
    14. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    15.                             (ByVal hwnd As Long, ByVal wMsg As Long, _
    16.                             ByVal wParam As Long, lParam As Any) As Long
    17.  
    18. Private Const HTCAPTION = 2
    19. Private Const WM_NCLBUTTONDOWN = &HA1
    20.  
    21. Private Sub Form_Load()
    22.     SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) + WS_DLGFRAME
    23. End Sub
    24.  
    25. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    26.     Select Case Button
    27.         Case vbRightButton
    28.             Me.PopupMenu mnupop
    29.         Case vbLeftButton
    30.             Me.MousePointer = vbSizeAll
    31.             ReleaseCapture
    32.             SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    33.             Me.MousePointer = vbArrow
    34.     End Select
    35. End Sub
    36.  
    37. Private Sub mnupopexit_Click()
    38.     Unload Me
    39. End Sub

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