bigfattoby Posted July 15, 2011 Share Posted July 15, 2011 (edited) Hey ive got this script. I want to make it so when you type your name into $Input1 and then i will be shown again at Input2, but just with the Sir/Mr/Baron title on. Ive done that with the titles, but i cant simply get my input boxses to work. Cloud someone help me? expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Hello Mr.", 446, 109, 192, 124) Global $Input1 = GUICtrlCreateInput("", 16, 16, 281, 21) Global $Button1 = GUICtrlCreateButton("Button1", 296, 8, 113, 41) Global $Checkbox1 = GUICtrlCreateRadio("Sir", 24, 40, 73, 25) Global $Checkbox2 = GUICtrlCreateRadio("Mr", 104, 40, 73, 25) Global $Checkbox3 = GUICtrlCreateRadio("Baron", 184, 40, 81, 25) Global $Input2 = GUICtrlCreateInput("", 8, 80, 417, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg=GUIGetMsg() If $msg =-3 Then Exit If $msg = $Checkbox1 Then checkbox1() If $msg = $button1 Then button1() WEnd Func Checkbox1() EndFunc Func button1() If GUICtrlRead($Checkbox1) = $GUI_UNCHECKED Then GUICtrlSetData($Input2, $YourName) EndIf If GUICtrlRead($Checkbox2) = $GUI_UNCHECKED Then GUICtrlSetData($Input2, $YourName) EndIf If GUICtrlRead($Checkbox3) = $GUI_UNCHECKED Then GUICtrlRead($Input2, $YourName) EndIf If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Sir " & $YourName) EndIf If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Mr " & $YourName) EndIf If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Baron " & $YourName) EndIf EndFunc //: bigfattoby Edited July 15, 2011 by bigfattoby Getting hang on the basic, still much to learn.If I take high class, taking high test im getting highscore right? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 15, 2011 Moderators Share Posted July 15, 2011 bigfattoby, You need to read the content of the input first and then look at the radio buttons like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Hello Mr.", 446, 109, 192, 124) Global $Input1 = GUICtrlCreateInput("", 16, 16, 281, 21) Global $Button1 = GUICtrlCreateButton("Button1", 296, 8, 113, 41) Global $Radio1 = GUICtrlCreateRadio("Sir", 24, 40, 73, 25) Global $Radio2 = GUICtrlCreateRadio("Mr", 104, 40, 73, 25) Global $Radio3 = GUICtrlCreateRadio("Baron", 184, 40, 81, 25) Global $Input2 = GUICtrlCreateInput("", 8, 80, 417, 21) GUISetState(@SW_SHOW) While 1 $msg=GUIGetMsg() If $msg =-3 Then Exit If $msg = $Radio1 Then Radio1() If $msg = $button1 Then button1() WEnd Func Radio1() EndFunc Func button1() $YourName = GUICtrlRead($Input1) If GUICtrlRead($Radio1) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Sir " & $YourName) ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Mr " & $YourName) ElseIf GUICtrlRead($Radio3) = $GUI_CHECKED Then GUICtrlSetData($Input2, "Baron " & $YourName) Else GUICtrlSetData($Input2, $YourName) EndIf EndFunc All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
bigfattoby Posted July 15, 2011 Author Share Posted July 15, 2011 Yes thank you. I can see you also made som other changes with in my Func button1()Does Else and ElseIf work better than just alots of IF and endif? Getting hang on the basic, still much to learn.If I take high class, taking high test im getting highscore right? Link to comment Share on other sites More sharing options...
Andreik Posted July 15, 2011 Share Posted July 15, 2011 Work in the same mode but get rid of extra lines. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now