Jump to content

Reset combo to default data possible?


Recommended Posts

If i have a couple of combo boxes like the ones below, is there a way to restore the default data in the combo if i click the other combo, or do i need to delete the combo and make a new one exactly like it?

Or... is it possible to simply update the combo data when i click the other combo?

GUICtrlCreateCombo("Name", 232, 232, 153, 25)
GUICtrlCreateCombo("Number", 232, 280, 153, 25)
Link to comment
Share on other sites

See GUICtrlSetData()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

See GUICtrlSetData()

I've tried that before, and tried again like this:

$Name = GUICtrlCreateCombo("Name", 232, 232, 153, 25)
$Number = GUICtrlCreateCombo("Number", 232, 280, 153, 25)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Name
          GUICtrlSetData($Number, "Number", "Number")
    EndSwitch
WEnd

Doesn't work. Maybe i'm doing it wrong, but all the strings displayed in the combo boxes remain the same. I have to do this to make it work:

_GUICtrlComboBox_Destroy($Number)
$NumeroLaudoGrupoAbrir = GUICtrlCreateCombo("Number", 232, 280, 153, 25)
GUICtrlSetState(-1, $GUI_ENABLE)

But it's not a very clean way to do it.

Link to comment
Share on other sites

$sData = "|Number|Alpha|string|pear|orange";;  NOTE the leading pipe.  It will clear the previous contents if any.
$Number = GUICtrlCreateCombo("", 232, 280, 153, 25)
GUICtrlSetData($number, $sData, "Number")

In the Switch statement do this

Case $Name
          GUICtrlSetData($Number, $sData, "orange")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

No problem. Glad to help.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...