Archive: How do I enable combo box based on user input?


How do I enable combo box based on user input?
I have a custom page with two combo boxes. I want the second cb disabled until the user picks something in the first combo box. I have not been successful getting this to work with GetDlgItem and EnableWindow.

When the user selects something from combo box 1, a function is called to fetch a list of directories and populate that into combo box 2. That part is working fine. I just think it's good design to have that combo box disabled until the user selects an option from the first combo box. And that's where I could use some help.

Thanks!

Here's my ini:

[Settings]
NumFields=4

[Field 1]
Type=Droplist
Text=Droplist
ListItems=Status 1|Status 2|Status 3
Left=28
Right=125
Top=41
Bottom=80
Flags=NOTIFY

[Field 2]
Type=Label
Text=Select a development status:
Left=28
Right=138
Top=30
Bottom=38

[Field 3]
Type=Droplist
Text=Droplist
ListItems=
Left=186
Right=283
Top=41
Bottom=116
Flags=NOTIFY

[Field 4]
Type=Label
Text=Select major release version:
Left=186
Right=284
Top=30
Bottom=38

Disregard. It was something silly. I set the combo box 2 FLAGS to DISABLED. In my leave function, I was already resetting the contents of combo box 2 with a ${CB_RESETCONTENT} window message. So I just used that variable in the EnableWindow command and everything is working.

ReadINIStr $1 "$PLUGINSDIR\pick_development_status.ini" "Field 3" "HWND"
SendMessage $1 ${CB_RESETCONTENT} 0 0
EnableWindow $1 1