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 

Checkbox and remember.

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



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 11:07 am    Post subject: Checkbox and remember. Reply with quote

Hi!
I want to create a checkbox for remember username and remember password.
How can i make this.
My gui is now :
Code:
Login = LOGIN TO S-MINER
Gui, 2:Font,cFF0000,
Gui, 2:Color, 000000
Gui, 2:+ToolWindow
Gui, 2:Add, Edit,-Vscroll cBlack x80 y12 w80 h20 vUsrname
Gui, 2:Add, Edit,-Vscroll cBlack x80 y42 w80 h20 vpasswrd Password
Gui, 2:Add, Text, x12 y12 w70 h20, Username
Gui, 2:Add, Text, x12 y42 w70 h20, Password
Gui, 2:Add, Button, x170 y12 w70 h20 Default, Login
Gui, 2:Add, Button, x170 y42 w70 h20 , Cancel
Gui, 2:Add, Text, x12 y120 w70 h20, News
Gui, 2:Add, Edit, x10 y135 w230 h60 ReadOnly, %newsss%
Gui, 2:Show, x299 y200 h200 w250, %Login%

Thank you for helping!
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Oct 06, 2009 11:19 am    Post subject: Reply with quote

Just write your variables username and password to an ini-file.
Look for iniwrite, iniread in the help-file.
Back to top
View user's profile Send private message
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 11:31 am    Post subject: Reply with quote

aaffe wrote:
Just write your variables username and password to an ini-file.
Look for iniwrite, iniread in the help-file.


i have looked for it for 2 weeks but i don't understood, if i get an example i will can do this Sad
Back to top
View user's profile Send private message
two examples
Guest





PostPosted: Tue Oct 06, 2009 11:36 am    Post subject: Reply with quote

where did you look for it? did you check the help?
Code:
IniWrite, this is a new value, C:\Temp\myfile.ini, section2, key

Code:
IniRead, OutputVar, C:\Temp\myfile.ini, section2, key
MsgBox, The value is %OutputVar%.
Back to top
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 11:48 am    Post subject: Reply with quote

two examples wrote:
where did you look for it? did you check the help?
Code:
IniWrite, this is a new value, C:\Temp\myfile.ini, section2, key

Code:
IniRead, OutputVar, C:\Temp\myfile.ini, section2, key
MsgBox, The value is %OutputVar%.


Thanks it's helped, but how does the checkbox work? :S sorry for my stupid answers i'm new in ahk Sad
Back to top
View user's profile Send private message
Two examples
Guest





PostPosted: Tue Oct 06, 2009 11:57 am    Post subject: Reply with quote

i donīt see any checkboxes in your script.
Back to top
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 12:08 pm    Post subject: Reply with quote

Two examples wrote:
i donīt see any checkboxes in your script.


because i don't know how they are work Sad
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Oct 06, 2009 12:10 pm    Post subject: Reply with quote

From the help:
Checkbox
Description: A small box that can be checked or unchecked to represent On/Off, Yes/No, etc.

Example: Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?
The last parameter is a label displayed next to the box, which is typically used as a prompt or description of what the checkbox does. It may include linefeeds (`n) to start new lines. If a width (W) is specified in Options but no rows (R) or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically. The checkbox's associated output variable (if any) receives the number 1 for checked, 0 for unchecked, and -1 for gray/indeterminate.

Specify the word Check3 in Options to enable a third state that displays a gray checkmark instead of a black one (the gray state indicates that the checkbox is neither checked nor unchecked). Specify the word Checked or CheckedGray in Options to have the checkbox start off with a black or gray checkmark, respectively. The word Checked may optionally be followed immediately by a 0, 1, or -1 to indicate the starting state. In other words, "Checked" and "Checked%VarContainingOne%" are the same.

A g-label such as gMySubroutine may be listed in the control's options. This would cause the MySubroutine label to be launched automatically whenever the user clicks or changes the checkbox.

Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including -Wrap (minus Wrap) in the button's options. However, this also prevents having more than one line of text.
Back to top
View user's profile Send private message
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 12:29 pm    Post subject: Reply with quote

aaffe wrote:
From the help:
Checkbox
Description: A small box that can be checked or unchecked to represent On/Off, Yes/No, etc.

Example: Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?
The last parameter is a label displayed next to the box, which is typically used as a prompt or description of what the checkbox does. It may include linefeeds (`n) to start new lines. If a width (W) is specified in Options but no rows (R) or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically. The checkbox's associated output variable (if any) receives the number 1 for checked, 0 for unchecked, and -1 for gray/indeterminate.

Specify the word Check3 in Options to enable a third state that displays a gray checkmark instead of a black one (the gray state indicates that the checkbox is neither checked nor unchecked). Specify the word Checked or CheckedGray in Options to have the checkbox start off with a black or gray checkmark, respectively. The word Checked may optionally be followed immediately by a 0, 1, or -1 to indicate the starting state. In other words, "Checked" and "Checked%VarContainingOne%" are the same.

A g-label such as gMySubroutine may be listed in the control's options. This would cause the MySubroutine label to be launched automatically whenever the user clicks or changes the checkbox.

Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including -Wrap (minus Wrap) in the button's options. However, this also prevents having more than one line of text.


Code:
Gui, 2:Add, Checkbox, x12 y100 vrememberusrpas, Remember Username/Password
<- i made this but how can i if checked iniread and iniwrite,
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Oct 06, 2009 12:33 pm    Post subject: Reply with quote

You have to check rememberusrpas if it is 1 or 0.
1 is checked, 0 is unchecked.
Back to top
View user's profile Send private message
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 12:34 pm    Post subject: Reply with quote

aaffe wrote:
You have to check rememberusrpas if it is 1 or 0.
1 is checked, 0 is unchecked.

oh thanks, and my last answer, how can i make the checkbox text to align left?
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Oct 06, 2009 12:35 pm    Post subject: Reply with quote

Code:

Gui, 2:Add, Checkbox, x12 y100 Left vrememberusrpas, Remember Username/Password

??
Btw: Youre asking questions, not answers Laughing
Back to top
View user's profile Send private message
ppeterpp



Joined: 08 Jul 2009
Posts: 61

PostPosted: Tue Oct 06, 2009 1:13 pm    Post subject: Reply with quote

aaffe wrote:
Code:

Gui, 2:Add, Checkbox, x12 y100 Left vrememberusrpas, Remember Username/Password

??
Btw: Youre asking questions, not answers Laughing


sorry, i just phone when i wrote this question Razz checkbox text is not on left :S
Back to top
View user's profile Send private message
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