|
-
May 12th, 2002, 11:14 AM
#1
Is it not possible
To have a PopUpMenu in a borderless form? It seems like a automaticaly get a border...
-
May 12th, 2002, 11:20 AM
#2
-= B u g S l a y e r =-
-
May 12th, 2002, 11:34 AM
#3
The picture isn't missing
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  .
-
May 12th, 2002, 11:40 AM
#4
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.
-
May 12th, 2002, 11:42 AM
#5
I have thought about that BuggyProgrammer.
But do I really need another form to do this?
-
May 12th, 2002, 11:44 AM
#6
-= B u g S l a y e r =-
oh.. see what u mean... seems BuggyProgrammers found the way though 
VB Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
PopupMenu Form1.mnuPopTest
End Sub
....
-
May 12th, 2002, 11:56 AM
#7
Ok
It works and thats the main thing.
-
May 12th, 2002, 12:06 PM
#8
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:
Option Explicit
'API Calls Used To Remove The Title Bar From Window (Make A Sizeable Borderless Form)
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_DLGFRAME = &H400000
'API Calls Used To Move A Form With The Mouse
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Sub Form_Load()
SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) + WS_DLGFRAME
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Button
Case vbRightButton
Me.PopupMenu mnupop
Case vbLeftButton
Me.MousePointer = vbSizeAll
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
Me.MousePointer = vbArrow
End Select
End Sub
Private Sub mnupopexit_Click()
Unload Me
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|