带菜单的无边框窗体
一,首先是一种很直接的解决方案:
这是声明块
Private DeclareFunction SetwindowLong Lib "user32" Alias "SetwindowLongA"(ByVal hwnd As Long,ByVal nIndex As Long,ByVal dwNewLong As Long) As Long
Private ConstGWL_STYLE = (-16)
然后在窗体加载模块中加入:SetwindowLongMe.hwnd,GWL_STYLE,lStyleAndNotWS_SIZEBox
这时,你的窗体就如你所愿了。
二,下面是间接达到目的的方法
1.另外做一个窗体form2 ,在form2中设置form1中需要的菜单。然后在form1中调用form2的右键菜单。
PrivateSubForm_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
If Button=2Then
PopupMenu form2.PopMenu
EndIf
EndSub
2. 做一个用户自定义控件,然后添加到窗体中。