這樣的效果嗎??
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <GuiComboBox.au3>
#include <WindowsConstants.au3>
;Global Const $WM_RBUTTONDOWN = 0x0204
GUIRegisterMsg($WM_RBUTTONDOWN, 'MyFunc')
Local $hGUI = GUICreate("ComboBox", 300, 200)
Local $idComboBox1 = GUICtrlCreateCombo("test1", 10, 10, 185, 20, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
Local $idComboBox2 = GUICtrlCreateCombo("中文1", 10, 50, 185, 20, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
$iClose = GUICtrlCreateButton("關閉", 210, 170, 85, 25)
GUICtrlSetData($idComboBox1, "test2|test3|test4", "test4")
GUICtrlSetData($idComboBox2, "中文2|中文3|中文4", "中文4")
GUISetState(@SW_SHOW, $hGUI)
While 1
; $Info = GUIGetCursorInfo($hGUI)
; If $Info[4] = $idComboBox1 Or $Info[4] = $idComboBox2 Then
; GUICtrlSetState($Info[4], $GUI_FOCUS)
; EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $iClose
ExitLoop
Case $idComboBox1
Case $idComboBox2
EndSwitch
WEnd
GUIDelete($hGUI)
Func MyFunc($HWnd, $iMsg, $wParam, $lParam)
$Info = GUIGetCursorInfo($hGUI)
If $Info[4] = $idComboBox1 Or $Info[4] = $idComboBox2 Then
GUICtrlSetState($Info[4], $GUI_FOCUS)
EndIf
EndFunc ;==>MyFunc
|