martin Posted April 20, 2007 Share Posted April 20, 2007 (edited) The text returned by _GUICtrlComboGetLBText is only the first letter if the variable name for the combobox is passed as a parameter, but is correct if the windows handle is passed. Looks like a bug to me. Can anyone confirm? Here is an example of problem seen with version beta 3.2.3.6 #include <GUIConstants.au3> #include <GUICombo.au3> dim $s_text GUICreate("My GUI combo"); will create a dialog box that when displayed is centered $CB = GUICtrlCreateCombo ("item1", 10,10); create first item GUICtrlSetData(-1,"item2|item3","item3"); add other item snd set a new default $b1 = GUICtrlCreateButton('show item 2 text ',20,50) $b2 = GUICtrlCreateButton('show item 2 text (using HWND)',20,80) GUISetState () While 1 $msg = GUIGetMsg() if $msg = $B1 Then _GUICtrlComboGetLBText($CB, 1, $s_text) MsgBox(0,'2nd item is',$s_text) EndIf if $msg = $B2 Then _GUICtrlComboGetLBText(GUICtrlGetHandle($CB), 1, $s_text) MsgBox(0,'2nd item is',$s_text) EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Edit - correct typo Edited April 20, 2007 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
PaulIA Posted April 20, 2007 Share Posted April 20, 2007 The text returned by _GUICtrlComboGetLBText is only the first letter if the variable name for the combobox is passed as a parameter, but is correct if the windows handle is passed. Looks like a bug to me. Can anyone confirm? Here is an example of problem seen with version beta 3.2.3.6 #include <GUIConstants.au3> #include <GUICombo.au3> dim $s_text GUICreate("My GUI combo"); will create a dialog box that when displayed is centered $CB = GUICtrlCreateCombo ("item1", 10,10); create first item GUICtrlSetData(-1,"item2|item3","item3"); add other item snd set a new default $b1 = GUICtrlCreateButton('show item 2 text ',20,50) $b2 = GUICtrlCreateButton('show item 2 text (using HWND)',20,80) GUISetState () While 1 $msg = GUIGetMsg() if $msg = $B1 Then _GUICtrlComboGetLBText($CB, 1, $s_text) MsgBox(0,'2nd item is',$s_text) EndIf if $msg = $B2 Then _GUICtrlComboGetLBText(GUICtrlGetHandle($CB), 1, $s_text) MsgBox(0,'2nd item is',$s_text) EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Edit - correct typoI believe that this has already been reported and fixed for next release. Check the Bugs forum for gafrost's posts. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
martin Posted April 20, 2007 Author Share Posted April 20, 2007 I believe that this has already been reported and fixed for next release. Check the Bugs forum for gafrost's posts.Yes thanks PauliA; I should have looked there first. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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