Archive: How do I reset a droplist?


RESOLVED: How do I reset a droplist?
I have a droplist in a custom dialog that has several items in ListItems. When the custom dialog is first displayed to the user, nothing is selected in the droplist. This is great and works as designed.

When the user picks something from the droplist, checkboxes on my custom dialog are checked or unchecked, etc. Sometimes the user might like to reset the form to the default settings. I can reset everything on the form, but the stinking droplist.

I have a validation section that's run on a custom reset button. I've tried different things but can't seem to make the droplist reset.

Here's what I've recently tried with the reset button.

ReadINIStr $1 "$PLUGINSDIR\setup.ini" "Field ${client_type_picklist}" "HWND"
SendMessage $1 ${LB_SETCURSEL} 0 0


Any ideas?

Totally un-researched and off-the-cuff guess:

If one of those zeros is the list index, I think that the unselected list index is -1. Try setting the index value to that.


I did a little research and found that I needed to use Combobox controls.

This seems to do the trick.

SendMessage $1 ${CB_SETCURSEL} -1 0