Optional. Specifies the name of a menu control in the pop-up menu to display its caption in bold text. If omitted, no controls in the pop-up menu appear in bold.
tyomitch писал(а):У стандартного метода PopupMenu жирный пункт задаётся последним параметром - DefaultMenu:Optional. Specifies the name of a menu control in the pop-up menu to display its caption in bold text. If omitted, no controls in the pop-up menu appear in bold.
GSerg писал(а):Проперть ItemDefault.
Option Explicit
Private Declare Function SetMenuDefaultItem Lib "user32" _
(ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPos As Long) As Long
Private Declare Function GetMenu Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Sub Form_Load()
'
On Error GoTo eRes
'//------------------------------------------------------------------------------------
Dim lMenuHwnd As Long, lSubMenuHwnd As Long
'//------------------------------------------------------------------------------------
lMenuHwnd = GetMenu(Me.hwnd)
lSubMenuHwnd = GetSubMenu(lMenuHwnd, 1)
lblActionRes.Caption = "SetMenuDefaultItem = " & SetMenuDefaultItem(lSubMenuHwnd, 0, 1)
Exit Sub
eRes:
Call MsgBox(Err.Description)
End Sub
SetMenuDefaultItem(lMenuHwnd, 0, 1)
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4