chenxu Posted September 10, 2008 Share Posted September 10, 2008 This is a simple example which exactly describes what I mean, just select an item contains Chinese characters and press the button. #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) Global $hCombo _Main() Func _Main() Local $hGUI ; Create GUI $hGUI = GUICreate("(UDF) ComboBox Create", 400, 296) $hCombo = _GUICtrlComboBox_Create($hGUI, "中文|这是一些中文|Chinese characters", 2, 2, 396, 296) GUISetState() Global $b = GUICtrlCreateButton("Read", 2, 40) GUICtrlSetOnEvent ($b, "_read") Local $msg While 1 $msg = GUIGetMsg() If $msg == $b Then _read() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() EndFunc ;==>_Main Func _read() Local $txt = _GUICtrlComboBox_GetEditText ($hCombo) MsgBox(0, "Read", "Not display the entire text of item which contains Chinese characters:" & @CRLF & @CRLF & $txt) EndFunc Link to comment Share on other sites More sharing options...
Pain Posted September 10, 2008 Share Posted September 10, 2008 Try to use GUICtrlRead($hCombo). Link to comment Share on other sites More sharing options...
chenxu Posted September 10, 2008 Author Share Posted September 10, 2008 Try to use GUICtrlRead($hCombo).Yes, I tried this function, it works. But there is another problem about this function. When the combobox drops down ( display the items), and move my mouse over an item in the rectangle, GUICtrlRead will read the text of the item under my mouse even I do not select the item. This is what I do not want. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now