人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開(kāi)發(fā)教程 > 詳細(xì)頁(yè)面

vb完成菜單右對(duì)齊

vb完成菜單右對(duì)齊

更新時(shí)間:2022-10-15 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

傳統(tǒng)的窗口菜單都是左對(duì)齊,是否可以右對(duì)齊,或窗口菜單左右分開(kāi)呢?

當(dāng)然可以!

新建一個(gè)工程,添加菜單(本例需要3列),添加四個(gè)按鈕控件,一個(gè)時(shí)間控件

添加以下代碼:

Option Explicit

Private Type menuItemInfo

cbSize As Long
fMask As Long
fType As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long

End Type

Private Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal

bool As Boolean, lpcMenuItemInfo As menuItemInfo) As Long
Private Declare Function GetMenuItemInfo Lib "user32" Alias "GetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal

b As Long, lpMenuItemInfo As menuItemInfo) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Public a As Integer

Private Sub Command1_Click()

Unload Me
Me.Show

Dim my_menuItemInfo As menuItemInfo
Dim return_value As Long

With my_menuItemInfo

.cbSize = 44
.fMask = 16
.cch = 128
.dwTypeData = Space$(128)

End With

return_value = GetMenuItemInfo(GetMenu(Me.hwnd), 3, 1, my_menuItemInfo)

my_menuItemInfo.fType = 16384
return_value = SetMenuItemInfo(GetMenu(Me.hwnd), 3, 1, my_menuItemInfo)

DrawMenuBar GetMenu(Me.hwnd)
Me.Refresh
Me.WindowState = 1
End Sub

Private Sub Command2_Click()

Dim my_menuItemInfo As menuItemInfo
Dim return_value As Long

With my_menuItemInfo

.cbSize = 44
.fMask = 16
.cch = 128
.dwTypeData = Space$(128)

End With

return_value = GetMenuItemInfo(GetMenu(Me.hwnd), 0, 1, my_menuItemInfo)

my_menuItemInfo.fType = 16384
return_value = SetMenuItemInfo(GetMenu(Me.hwnd), 0, 1, my_menuItemInfo)

DrawMenuBar GetMenu(Me.hwnd)
Me.Refresh
Me.WindowState = 1
End Sub

Private Sub Command3_Click()
Unload Me
Me.Show
Dim my_menuItemInfo As menuItemInfo
Dim return_value As Long

With my_menuItemInfo

.cbSize = 44
.fMask = 16
.cch = 128
.dwTypeData = Space$(128)

End With

return_value = GetMenuItemInfo(GetMenu(Me.hwnd), 1, 1, my_menuItemInfo)

my_menuItemInfo.fType = 16384
return_value = SetMenuItemInfo(GetMenu(Me.hwnd), 1, 1, my_menuItemInfo)

DrawMenuBar GetMenu(Me.hwnd)
Me.Refresh
Me.WindowState = 1

End Sub

Private Sub Command4_Click()
Unload Me
Me.Show


Dim my_menuItemInfo As menuItemInfo
Dim return_value As Long

With my_menuItemInfo

.cbSize = 44
.fMask = 16
.cch = 128
.dwTypeData = Space$(128)

End With

return_value = GetMenuItemInfo(GetMenu(Me.hwnd), 2, 1, my_menuItemInfo)

my_menuItemInfo.fType = 16384
return_value = SetMenuItemInfo(GetMenu(Me.hwnd), 2, 1, my_menuItemInfo)

DrawMenuBar GetMenu(Me.hwnd)
Me.Refresh
Me.WindowState = 1

End Sub



Private Sub Timer1_Timer()

If Me.WindowState = 1 Then Me.WindowState = 0

End Sub

運(yùn)行一下,如何?

注意四個(gè)按鈕不同的一個(gè)參數(shù),那表示左邊有幾個(gè)菜單項(xiàng)

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 淄博市| 二手房| 怀来县| 徐汇区| 北流市| 扶沟县| 尚志市| 揭阳市| 三门峡市| 咸宁市| 桦川县| 永靖县| 瓦房店市| 荔浦县| 上饶市| 巴东县| 雅安市| 彭阳县| 大英县| 海门市| 香格里拉县| 临洮县| 五家渠市| 腾冲县| 甘南县| 平利县| 固原市| 阿巴嘎旗| 丰城市| 内江市| 长沙县| 应用必备| 屯留县| 宁蒗| 龙南县| 岗巴县| 夏邑县| 乳源| 泰和县| 巴林右旗| 通辽市|