'关于标准下拉框的
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
Const CB_SHOWDROPDOWN = &H14F
Const CB_GETDROPPEDWIDTH = &H15F
Const CB_SETDROPPEDWIDTH = &H160
'改变下拉框的宽度,NewWidth为新宽度,可用strtmp取得最长的下拉框中的字符串,NewWidth=TextWidth(strTmp) * cbo1.FontSize / 9
SendMessage cbo1.hwnd, CB_SETDROPPEDWIDTH, NewWidth, 0
'弹出下拉框
SendMessage cbo1.hwnd, CB_SHOWDROPDOWN, True, 0
'调用关机界面,可能没什么用
Private Declare Function SHShutDownDialog Lib "shell32" Alias "#60" (ByVal YourGuess As Long) As Long
Call SHShutDownDialog(&O0)
没有评论:
发表评论