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 

Dynamically update groupbox text

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






PostPosted: Wed Mar 22, 2006 8:48 pm    Post subject: Dynamically update groupbox text Reply with quote

I have a groupbox and it is associated with a dropdown menu. I want the text to change to the selected text of the dropdown menu.

Is there a better way than to create several boxes in the same place and then show or hide them as needed?
Back to top
rlandersen



Joined: 22 Mar 2006
Posts: 7

PostPosted: Wed Mar 22, 2006 9:32 pm    Post subject: Reply with quote

Actually this question goes for any menu item.


I have an action associated with a change in the combo box that will call a function that has some lines like
gui, add, checkbox, vVar1 show%var2%, text

When I change the dropdown box everything functions correctly but I get an error on the second time I change the state that states that same variable cannot be used for more than one control per window.
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Mar 22, 2006 9:49 pm    Post subject: Reply with quote

That is correct. You can only add a control once. After that you should use GuiControl to show/hide a control, or to change it's text, size, state, etc.
Back to top
rlandersen



Joined: 22 Mar 2006
Posts: 7

PostPosted: Wed Mar 22, 2006 10:10 pm    Post subject: Solved Reply with quote

Thanks

It is the control: GuiControl that changes that status. So I had to create the controls at the first and then on menu selection call guicontrol, show%var2% to switch.

One more question, when I first enter the menu, I do the command:
"Gui, Add, Checkbox, vVar1 show0, Open"
or the command:
"Gui, Add, Checkbox, vVar1 hide, Open"

and it will not hide the item. Does an add always show it? How can I add the element but not display it.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Thu Mar 23, 2006 5:50 am    Post subject: Reply with quote

HI,

The above Guest was also me.

You should take a look at the manual. The option for Gui,Add is "hidden%var%", on GuiControl it is "show%var%" or "hide%var%".
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   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