Swimming_Bird Posted January 14, 2006 Share Posted January 14, 2006 I define the objects in the control like this: #include <GUIConstants.au3> Global $programnames Func _getnames () Local $configini = IniReadSectionNames ( 'config.ini' ) $programnames = $configini[1] For $n=2 To $configini[0] $programnames = $programnames & '|' & $configini[$n] Next EndFunc _getnames () This is the how i'm using my combobox: Opt ( 'GUICoordMode' , 1 ) $refresh2 = GUICtrlCreateButton ( 'Refresh' ,350 , 52 ) GUICtrlCreateLabel ( 'Program Name' , 7 , 60 , 80 , 17 ) Opt ( 'GUICoordMode' , 2 ) $combo2 = GUICtrlCreateCombo ( '' , -1 , 1 , 390 ) GUICtrlSetData ( -1 , $programnames ) GUICtrlCreateButton ( 'Delete This Program' , -1 , 8 , 390 , 20) And this is how i call for it to reset: While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $refresh Or $msg = $refresh2 _getnames () GUICtrlSetData ( $combo1 , $programnames ) GUICtrlSetData ( $combo2 , $programnames ) EndSelect Wend The problem is that every time i reset it just adds whatever it reads to the end of the combobox instead of completely refreshing it. Any help is appreciated. Thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 14, 2006 Moderators Share Posted January 14, 2006 I define the objects in the control like this: #include <GUIConstants.au3> Global $programnames Func _getnames () Local $configini = IniReadSectionNames ( 'config.ini' ) $programnames = $configini[1] For $n=2 To $configini[0] $programnames = $programnames & '|' & $configini[$n] Next EndFunc _getnames () This is the how i'm using my combobox: Opt ( 'GUICoordMode' , 1 ) $refresh2 = GUICtrlCreateButton ( 'Refresh' ,350 , 52 ) GUICtrlCreateLabel ( 'Program Name' , 7 , 60 , 80 , 17 ) Opt ( 'GUICoordMode' , 2 ) $combo2 = GUICtrlCreateCombo ( '' , -1 , 1 , 390 ) GUICtrlSetData ( -1 , $programnames ) GUICtrlCreateButton ( 'Delete This Program' , -1 , 8 , 390 , 20) And this is how i call for it to reset: While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $refresh Or $msg = $refresh2 _getnames () GUICtrlSetData ( $combo1 , $programnames ) GUICtrlSetData ( $combo2 , $programnames ) EndSelect Wend The problem is that every time i reset it just adds whatever it reads to the end of the combobox instead of completely refreshing it. Any help is appreciated. Thanks While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $refresh Or $msg = $refresh2 GUICtrlSetData ( $combo1 , '' ) GUICtrlSetData ( $combo2 , '' ) _getnames () GUICtrlSetData ( $combo1 , $programnames ) GUICtrlSetData ( $combo2 , $programnames ) EndSelect Wend Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 14, 2006 Developers Share Posted January 14, 2006 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $refresh Or $msg = $refresh2 _getnames () GUICtrlSetData ( $combo1 , "|" & $programnames ) GUICtrlSetData ( $combo2 , "|" & $programnames ) EndSelect Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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