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 

Simple Gui Question

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



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Dec 10, 2007 1:52 am    Post subject: Simple Gui Question Reply with quote

I must be a moron, but this has been driving me nuts for over an hour now:

All I want to do is be able to change the label name... Like replace "Player 1" with that players actual name. Argghh... please help, and sorry as I realize this is trivial, but I just can't get it.

Gui, Font, S8 CDefault, Verdana
Gui, Add, Text, x6 y0 w120 h20 +Center, DAMA'S M CALC
Gui, Add, Text, x6 y30 w80 h20 +Border, Player 1
Gui, Add, Text, x6 y50 w80 h20 +Border, Player 2
Gui, Add, Text, x6 y70 w80 h20 +Border, Player 3
Gui, Add, Text, x6 y90 w80 h20 +Border, Player 4
Gui, Add, Text, x6 y110 w80 h20 +Border, Player 5
Gui, Add, Text, x6 y130 w80 h20 +Border, Player 6
Gui, Add, Text, x6 y150 w80 h20 +Border, Player 7
Gui, Add, Text, x6 y170 w80 h20 +Border, Player 8
Gui, Add, Text, x6 y190 w80 h20 +Border, Player 9
Gui, Add, Text, x6 y210 w80 h20 +Border, Player 10
Gui, Add, Text, x86 y30 w40 h20 +Border, M1
Gui, Add, Text, x86 y50 w40 h20 +Border, M2
Gui, Add, Text, x86 y70 w40 h20 +Border, M3
Gui, Add, Text, x86 y90 w40 h20 +Border, M4
Gui, Add, Text, x86 y110 w40 h20 +Border, M5
Gui, Add, Text, x86 y130 w40 h20 +Border, M6
Gui, Add, Text, x86 y150 w40 h20 +Border, M7
Gui, Add, Text, x86 y170 w40 h20 +Border, M8
Gui, Add, Text, x86 y190 w40 h20 +Border, M9
Gui, Add, Text, x86 y210 w40 h20 +Border, M10

; Generated using SmartGUI Creator 4.0

Gui, Show, x131 y91 h244 w135,
Return

GuiClose:
ExitApp
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Dec 10, 2007 2:00 am    Post subject: Reply with quote

look up GuiControl
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
DerRaphael



Joined: 23 Nov 2007
Posts: 456
Location: Heidelberg, Germany

PostPosted: Mon Dec 10, 2007 2:43 am    Post subject: Reply with quote

Code:

Gui, Font, S8 CDefault, Verdana
Gui, Add, Text, x6 y0 w120 h20 +Center, DAMA'S M CALC
Gui, Add, Text, vp1 x6 y30 w80 h20 +Border, Player 1
Gui, Add, Text, vp2 x6 y50 w80 h20 +Border, Player 2
Gui, Add, Text, vp3 x6 y70 w80 h20 +Border, Player 3
Gui, Add, Text, vp4 x6 y90 w80 h20 +Border, Player 4
Gui, Add, Text, vp5 x6 y110 w80 h20 +Border, Player 5
Gui, Add, Text, vp6 x6 y130 w80 h20 +Border, Player 6
Gui, Add, Text, vp7 x6 y150 w80 h20 +Border, Player 7
Gui, Add, Text, vp8 x6 y170 w80 h20 +Border, Player 8
Gui, Add, Text, vp9 x6 y190 w80 h20 +Border, Player 9
Gui, Add, Text, vp10 x6 y210 w80 h20 +Border, Player 10
Gui, Add, Text, x86 y30 w40 h20 +Border, M1
Gui, Add, Text, x86 y50 w40 h20 +Border, M2
Gui, Add, Text, x86 y70 w40 h20 +Border, M3
Gui, Add, Text, x86 y90 w40 h20 +Border, M4
Gui, Add, Text, x86 y110 w40 h20 +Border, M5
Gui, Add, Text, x86 y130 w40 h20 +Border, M6
Gui, Add, Text, x86 y150 w40 h20 +Border, M7
Gui, Add, Text, x86 y170 w40 h20 +Border, M8
Gui, Add, Text, x86 y190 w40 h20 +Border, M9
Gui, Add, Text, x86 y210 w40 h20 +Border, M10

Gui, Add, Button, x6 gNameChange w120, Change Player

; Generated using SmartGUI Creator 4.0

Gui, Show
Return

GuiClose:
ExitApp

NameChange:
InputBox, No,Enter player number,  Please enter the number of the player (1 to 10)`nyou want to change
if !(No) {
   return
}
if No is not integer
{
   MsgBox,37,Error, Your input must be a number from 1 to 10`n`nWant to try again?
   IfMsgBox, Retry
      Goto NameChange
   else
      return
} else if (No<1) or (No>10) {
   MsgBox,37,Error, The playerNumer does not exist!`nYour input must be a number from 1 to 10`n`nWant to try again?
   IfMsgBox, Retry
      Goto NameChange
   else
      return
} else {
   InputBox, Name, Enter new players Name, Please Enter the Name of Player #%No%
   GuiControl, , p%No%, %No%. %Name%
}

return


this way it works

greets
derRaphael
Back to top
View user's profile Send private message
damajha



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Dec 10, 2007 2:52 am    Post subject: Reply with quote

Thanks both of you!!

Much appreciated
Back to top
View user's profile Send private message
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