 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
aaffe
Joined: 17 May 2007 Posts: 66
|
Posted: Wed Dec 19, 2007 1:41 pm Post subject: how to start GUI with button enabled or dislabed |
|
|
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
|
|
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1158 Location: Denmark
|
Posted: Wed Dec 19, 2007 1:52 pm Post subject: |
|
|
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
} |
_________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 66
|
Posted: Wed Dec 19, 2007 2:01 pm Post subject: |
|
|
Hy tonne,
thanks a lot again! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|