AutoHotkey Community

It is currently May 27th, 2012, 12:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 23rd, 2009, 11:24 pm 
How do I get GuiControl to work on Gui 2 instead of 1?

I tried Gui 2:+LastFound, but that doesn't work. When I click the Options button, it enables the control on the wrong Gui. Once Gui 2 is open, clicking the checkbox toggles the DateTime control properly.

Code:
Gui, 1:Add, Button,,Options
Gui, 1:Add, DateTime, vTestControl Disabled, Time

bReminderOn := True
Gui, 2:Add, Checkbox, vbReminderOn gReminderTimeChecked Checked%bReminderOn%, Remind me at:
Gui, 2:Add, DateTime, vReminderTime Disabled, Time
Gui, 1:Show
Return

ButtonOptions:
{
    If bReminderOn
    {
      Gui 2:+LastFound
      GuiControl, Enable, ReminderTime
      GuiControl, Enable, TestControl
    }
    Else
    {
      Gui 2:+LastFound
      GuiControl, Disable, ReminderTime
      GuiControl, Disable, TestControl
    }
    Gui, 2:Show
  Return
}

ReminderTimeChecked:
{
  If bReminderOn
  {
    bReminderOn := False
    Gui 2:+LastFound
    GuiControl, Disable, ReminderTime
  }
  Else
  {
    bReminderOn := True
    Gui 2:+LastFound
    GuiControl, Enable, ReminderTime
  }
  Return
}



Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2009, 11:29 pm 
Offline
User avatar

Joined: October 31st, 2008, 9:39 am
Posts: 641
Location: France
try this:
Code:
GuiControl, 2:Disable, example
GuiControl, 2:Enable, example


and for GuiControl without first param it's the same way
Code:
GuiControl, 2:, example


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2009, 11:38 pm 
Thanks Zaelia. That worked like a charm.

By chance, do you know who I would contact to suggest adding that to the GuiControl page as an example?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2009, 11:47 pm 
Offline

Joined: June 17th, 2008, 7:51 am
Posts: 243
Put it into here: http://www.autohotkey.com/forum/viewtopic.php?t=2822

_________________
Greetings
Rog


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2009, 11:47 pm 
Offline
User avatar

Joined: October 31st, 2008, 9:39 am
Posts: 641
Location: France
perhaps here (wish list)
http://www.autohotkey.com/forum/viewforum.php?f=4


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 24th, 2009, 3:29 am 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
MikeC wrote:
By chance, do you know who I would contact to suggest adding that to the GuiControl page as an example?

Read the damn manual...

Directly from the manual on GuiControl
Quote:
Remarks
_________________________

To operate upon a window number other than the default (see below), include a number followed by a colon in front of the sub-command as in these examples:
Code:
GuiControl, 2:Show, MyButton
GuiControl, 2:, MyListBox, Item1|Item2

A GUI thread is defined as any thread launched as a result of a GUI action. GUI actions include selecting an item from a GUI window's menu bar, or triggering one of its g-labels (such as by pressing a button).

The default window number for a GUI thread is that of the window that launched the thread. Non-GUI threads use 1 as their default.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Leef_me, Ohnitiel, XstatyK and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group