AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dropdown list - setting value

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
PaulW
Guest





PostPosted: Mon Mar 15, 2010 9:14 pm    Post subject: dropdown list - setting value Reply with quote

I've been playing with this listview script:
http://www.autohotkey.com/forum/post-44471.html#44471

It seems to be working great apart from I've change the gui to include a drop downlist.

How do I get the dropdown list to show the entry I have selected in the list view??

ie:
Code:
SMGUI:
  Gui,2:Add,Text, xm Section w80, NAME
  Gui,2:Add,Edit, ys-4 w420  vA41, %A31%
  Gui,2:Add,Text, xm Section w80  , EMAIL
  Gui,2:Add,Edit, ys-4 w420  vA42, %A32%
  Gui,2:Add,Text, xm Section w80  , WWW
  Gui,2:Add,Edit, ys-4 w420  vA43, %A33%
  Gui,2:Add,Text, xm Section w80  , COLOR
  Gui,2:Add, DropDownList, ys-4 vA44, |aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow
  Gui,2:Add, Button, xm, OK
  Gui,2:Show, , NAME-INPUT
return


name shows the name from the listview, email shows the email from the list view.. BUT how do I get COLOR to show the color from the list view ???

Thanks Smile
Back to top
wooly_sammoth



Joined: 12 May 2009
Posts: 634
Location: Gloucester UK

PostPosted: Tue Mar 16, 2010 10:27 am    Post subject: Reply with quote

I'd use GuiControl, ChooseString

There's this in the Documentation
Quote:
GuiControl, ChooseString, ControlID, String: Sets the selection (choice) in a ListBox, DropDownList, ComboBox, or Tab control to be the entry whose leading part matches String. The search is not case sensitive. For example, if a the control contains the item "UNIX Text", specifying the word unix (lowercase) would be enough to select it. The pipe and double-pipe prefix are also supported (see "Choose" above for details).
Back to top
View user's profile Send private message Visit poster's website
PaulW
Guest





PostPosted: Tue Mar 16, 2010 5:19 pm    Post subject: Reply with quote

Thanks.

I had looked at that, but couldn't get it to work !

Can anyone help ?

Regards
Back to top
PaulW
Guest





PostPosted: Tue Mar 16, 2010 5:29 pm    Post subject: Reply with quote

Got It !!

Code:
SMGUI:
  Gui,2:Add,Text, xm Section w80, NAME
  Gui,2:Add,Edit, ys-4 w420  vA41, %A31%
  Gui,2:Add,Text, xm Section w80  , EMAIL
  Gui,2:Add,Edit, ys-4 w420  vA42, %A32%
  Gui,2:Add,Text, xm Section w80  , WWW
  Gui,2:Add,Edit, ys-4 w420  vA43, %A33%
  Gui,2:Add,Text, xm Section w80  , COLOR
  Gui,2:Add, DropDownList, ys-4 vA44, |aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow
  GuiControl, 2:ChooseString, A44, %A34%
  Gui,2:Add, Button, xm, OK
  Gui,2:Show, , NAME-INPUT
return


I missed the 2: from ChooseString !!
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group