Old 20th January 2010, 16:56   #1
toddmw
Junior Member
 
Join Date: Dec 2009
Posts: 2
Question 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.
code:
ReadINIStr $1 "$PLUGINSDIR\setup.ini" "Field ${client_type_picklist}" "HWND"
SendMessage $1 ${LB_SETCURSEL} 0 0



Any ideas?

Last edited by toddmw; 20th January 2010 at 18:33.
toddmw is offline   Reply With Quote
Old 20th January 2010, 17:46   #2
CrushBug
Senior Member
 
Join Date: May 2005
Posts: 119
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.
CrushBug is offline   Reply With Quote
Old 20th January 2010, 18:15   #3
toddmw
Junior Member
 
Join Date: Dec 2009
Posts: 2
I did a little research and found that I needed to use Combobox controls.

This seems to do the trick.
code:
SendMessage $1 ${CB_SETCURSEL} -1 0
toddmw is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump