AutoHotkey Community

It is currently May 26th, 2012, 1:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: December 19th, 2007, 1:41 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Hy,
I created a Gui which has a special button. Now I want to check if there exists a special filename and if yes, the button has to be active, if not, it has to be inactive.
When another button is clicked I can change the mode of the button via
GuiControl,-enabled,Buttonname
, but directly when the program is started without clicking a button I can´t depend the state of the button reliable of the existing of a file.
Can please someone help me?
Code:



Gui, Add, Button, x86 y70 w290 h50 gSetzen, Button1
Gui, Add, Button, x86 y157 w290 h50 %a% gDasi, Button2
Gui, Add, Button, x126 y247 w210 h40 gBeenden, Beenden
Gui, Font, underline S10 bold
IfExist,D:\S3000\Temp\EK1_EK2_Sicherung.unl
   GuiControl,-enabled,Button2
else
   GuiControl,-disabled,Button2
Gui, Show, x131 y137 h307 w479, mein Fenster


Button1:
  ; I wonder why this command can change the button-state, but not the one by the IfExist-command....
  GuiControl,-disabled,Button2
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2007, 1:52 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Snippet
Code:
  Gui, Add, Button, x462 y12 w80 gProgram_OK vProgram_OK Default, OK
  Gui, Add, Button, x462 y52 w80 gProgram_Cancel,                 &Annuller
  If Adding
  {
    GuiControl,Disable,Program_OK
    Gui, Show,, Tilføj program
  }
  Else
  {
    Gui, Add, Button, x462 y92 w80         gProgram_SaveAs vProgram_SaveAs, &Gem som
    GuiControl,Disable,Program_SaveAs
    Gui, Show,, Ret program
  }

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2007, 2:01 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Hy tonne,
thanks a lot again!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 44 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