Hi,
ich möchte nachdem ich einen Wert in einer ComboBox ausgewählt habe verhindern, dass mit dem Mausrad der Wert in der ComboBox verändert werden kann.
Gibt es da einen Stil dafür.
Im Moment behelfe ich mir mit ControlFocus.
AutoIt
#Region ;************ Includes ************
#Include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#EndRegion ;************ Includes ************
Opt("GUIOnEventMode", 1)
$hGui = GUICreate("Test", 400, 300)
GUISetState(@SW_SHOW)
Global $idCombo = _GUICtrlComboBoxEx_Create($hGui, "", 10, 10, 170, 200, $CBS_DROPDOWNLIST)
Global $hImagelist = _GUIImageList_Create(32, 32, 5, 3)
_GUICtrlComboBoxEx_SetImageList($idCombo, $hImagelist)
_GUIImageList_AddIcon($hImagelist, "shell32.dll", 10, True)
_GUICtrlComboBoxEx_AddString($idCombo, "Test", 0, 0)
_GUICtrlComboBoxEx_AddString($idCombo, "Test2", 0, 0)
Global $idLabel = GUICtrlCreateLabel("Test", 10, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
Sleep(10)
WEnd
Func _exit()
Exit
EndFunc ;==>_exit
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode
$hWndFrom = $lParam
$iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
$iCode = BitShift($wParam, 16) ; Hi Word
Switch $hWndFrom
Case $idCombo
Switch $iCode
Case $CBN_SELCHANGE
ControlFocus($hGui, "", $idLabel) ;>>> auch anders möglich?
Return 0
EndSwitch
EndSwitch
EndFunc
Alles anzeigen