tattoofreak87 Posted April 28, 2015 Share Posted April 28, 2015 Hey all I am new here so i apologize if i am placing the following in formation into the wrong section of the forum, I do not know AutoIT very well, I am looking for assistance on how to create a "generate and copy notes" button that will be able to gather all the information placed in either the input fields or checkbox fields and have it coppied to clipboard and then be able to paste it into notepad. The following is the current code I am working with, I will be adding more fields i am wondering if someone can either do it for me and then explain to me what you did or explain to me on what to do, i have been all over youtube and the forums here and i have had no luck any help please and thanks expandcollapse popupinclude <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\vince s\documents\sales note template.kxf $Form1 = GUICreate("Sales Note Template", 824, 738, -1, -1) $SalesAgentName = GUICtrlCreateLabel("Sales Agent Name", 72, 8, 132, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateInput("", 8, 88, 249, 21) GUICtrlCreateLabel("Customer Full Name", 56, 64, 147, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateInput("", 8, 32, 249, 21) $Label2 = GUICtrlCreateLabel("Customer E-Mail Address", 40, 120, 183, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateInput("", 8, 144, 249, 21) $Input1 = GUICtrlCreateInput("", 8, 224, 121, 21) $Input2 = GUICtrlCreateInput("", 136, 224, 121, 21) $Label3 = GUICtrlCreateLabel("Customer Phone Number", 40, 176, 183, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") $Label4 = GUICtrlCreateLabel("Primary", 48, 208, 38, 17) $Label5 = GUICtrlCreateLabel("Secondary", 168, 208, 55, 17) $Label6 = GUICtrlCreateLabel("Plan Purchased", 72, 256, 115, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateCombo("", 8, 288, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only") $Label8 = GUICtrlCreateLabel("Total Amount Paid", 56, 512, 132, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateInput("$", 56, 536, 121, 21) $Label7 = GUICtrlCreateLabel("Software Purchased", 56, 320, 147, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateCombo("", 8, 352, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased") $Label9 = GUICtrlCreateLabel("Computers Signed Up", 48, 440, 160, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateCheckbox("1 PC", 24, 472, 49, 17) $Checkbox1 = GUICtrlCreateCheckbox("2 PC", 104, 472, 57, 17) $Checkbox2 = GUICtrlCreateCheckbox("3 PC", 176, 472, 49, 17) $Label10 = GUICtrlCreateLabel("Operating System", 64, 384, 130, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") GUICtrlCreateCombo("", 8, 408, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Windows|Mac") $Button1 = GUICtrlCreateButton("Generate Notes", 24, 584, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 28, 2015 Moderators Share Posted April 28, 2015 (edited) First off, it will help you immensely to begin organizing your code. It'll be easier for you to read and debug, as well as anyone assisting you. For GUIs I tend to group controls together like so:expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\vince s\documents\sales note template.kxf $Form1 = GUICreate("Sales Note Template", 824, 738, -1, -1) GUISetFont(-1, 11, 800, 0, "Arial") $SalesAgentName = GUICtrlCreateLabel("Sales Agent Name", 72, 8, 132, 22) ;Labels: GUICtrlCreateLabel("Customer Full Name", 56, 64, 147, 22) $Label2 = GUICtrlCreateLabel("Customer E-Mail Address", 40, 120, 183, 22) $Label3 = GUICtrlCreateLabel("Customer Phone Number", 40, 176, 183, 22) $Label4 = GUICtrlCreateLabel("Primary", 48, 208, 38, 17) $Label5 = GUICtrlCreateLabel("Secondary", 168, 208, 55, 17) $Label6 = GUICtrlCreateLabel("Plan Purchased", 72, 256, 115, 22) $Label7 = GUICtrlCreateLabel("Software Purchased", 56, 320, 147, 22) $Label8 = GUICtrlCreateLabel("Total Amount Paid", 56, 512, 132, 22) $Label9 = GUICtrlCreateLabel("Computers Signed Up", 48, 440, 160, 22) $Label10 = GUICtrlCreateLabel("Operating System", 64, 384, 130, 22) ;Inputs $Input1 = GUICtrlCreateInput("", 8, 88, 249, 21) $Input2 = GUICtrlCreateInput("", 8, 32, 249, 21) $Input3 = GUICtrlCreateInput("", 8, 144, 249, 21) $Input4 = GUICtrlCreateInput("", 8, 224, 121, 21) $Input5 = GUICtrlCreateInput("", 136, 224, 121, 21) $Input6 = GUICtrlCreateInput("$", 56, 536, 121, 21) ;Combo Boxes GUICtrlCreateCombo("", 8, 288, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only") GUICtrlCreateCombo("", 8, 352, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased") GUICtrlCreateCombo("", 8, 408, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Windows|Mac") ;CheckBoxes GUICtrlCreateCheckbox("1 PC", 24, 472, 49, 17) $Checkbox1 = GUICtrlCreateCheckbox("2 PC", 104, 472, 57, 17) $Checkbox2 = GUICtrlCreateCheckbox("3 PC", 176, 472, 49, 17) ;Buttons $Button1 = GUICtrlCreateButton("Generate Notes", 24, 584, 75, 25) $Button2 = GUICtrlCreateButton("Copy Notes", 124, 584, 175, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Regarding your issue, you've already created one button, so creating and placing a second should not be an issue. You then use GUICtrlRead to get the value of whatever controls you want to read. Like so:While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button2 $ouput = GUICtrlRead($Input1) & @CRLF & _ GUICtrlRead($Input2) & @CRLF & _ GUICtrlRead($Input3) & @CRLF ;...etc. etc. you get the idea ClipPut($ouput) ConsoleWrite(ClipGet() & @CRLF) ;so you can see it is on the clipboard. EndSwitch WEnd Also, as a bit constructive criticism, you assigned variable names to all of your labels, but not all of your other controls. If you are not going to change the name of the label, you usually don't have to bother with assigning it a variable name. For other controls, such as input fields and checkboxes, you do want to assign a variable, so you can interact with it later on.Once you get more familiar with creating and getting info from a GUI, you'll find there are easier ways to declare and interact with the controls that will lead to fewer lines (such as declaring all of your input boxes through an array and then looping through it to read all the values). But this should get you started for the moment. Edited April 28, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
nitekram Posted April 29, 2015 Share Posted April 29, 2015 I personally would also use more descriptive names for your inputs, but if you are going to only use them once, no big deal, but it is easier to name variables with names of what they do, so for instance my input boxes might all start with $CustNameInput, $CustEmailInput or $InputCustName, $InputCustEmail. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
tattoofreak87 Posted April 29, 2015 Author Share Posted April 29, 2015 I have tried to edit the code however it is not running right,it is stating that input1 is the customer name input box when it is in fact the sales agent name Link to comment Share on other sites More sharing options...
BrewManNH Posted April 29, 2015 Share Posted April 29, 2015 That's because you have your inputs in the wrong place for what you think they're intended for. You created the Sales Agent Name input at 8,88 and the customer name at 8,32 those two should be reversed. This is why you should name your variables/controls better so you can track what is happening in your script.. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
tattoofreak87 Posted April 30, 2015 Author Share Posted April 30, 2015 okay thank you for the information, i am working on that better now i am re-doing this one line at a time just one more quick bit of assistancethe code that i have in red, it is working the way i want but i can't figure out the space code to put a space in between?#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\Vince S\Documents\Form2.kxf $Form2 = GUICreate("Form2", 615, 503, 193, 122) $AgentName = GUICtrlCreateLabel("Sales Agent Name:", 72, 88, 92, 17) $InputAgentName = GUICtrlCreateInput("", 72, 136, 121, 21) $Generate = GUICtrlCreateButton("Save And Copy Notes", 88, 248, 147, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Generate $output = GUICtrlRead($AgentName) & @CRLF & GUICtrlRead($InputAgentName) ClipPut($output) ConsoleWrite(ClipGet() & @CRLF) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 30, 2015 Moderators Share Posted April 30, 2015 The space between what? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
tattoofreak87 Posted April 30, 2015 Author Share Posted April 30, 2015 Okay i figured out the spacing that I wanted to do, now i'm running into my next problemI want the results to look like thisSales Agent Name: john smithCustomer Full Name: John smith While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $CopyNotes $output = GUICtrlRead($SalesAgentName) & GUICtrlRead($InputAgentName) $output = GUICtrlRead($CustomerFullName) & GUICtrlRead($InputCustomerName) $output = GUICtrlRead($CustomerEmailAdd) & GUICtrlRead($InputCustomerEmailAdd) $output = GUICtrlRead($CustomerNumber) & GUICtrlRead($PrimaryNumber & $SecondaryNumber) $output = GUICtrlRead($PlanPurchased) & GUICtrlRead($SelectPlan) $output = GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) $output = GUICtrlRead($OperatingSystem) & GUICtrlRead($SelectOperatingSystem) $output = GUICtrlRead($ComputersSignedUp) & GUICtrlRead($Checkbox1) $output = GUICtrlRead($TotalAmountPaid) & GUICtrlRead($InputAmountPaid) ClipPut($output) ConsoleWrite(ClipGet() & @CRLF) EndSwitch WEnd Link to comment Share on other sites More sharing options...
tattoofreak87 Posted April 30, 2015 Author Share Posted April 30, 2015 I have even tried to write it up like this to see if this is the fix and still nothing expandcollapse popupWhile 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $CopyNotes $output = GUICtrlRead($SalesAgentName) & GUICtrlRead($InputAgentName) $output2 = GUICtrlRead($CustomerFullName) & GUICtrlRead($InputCustomerName) $output3 = GUICtrlRead($CustomerEmailAdd) & GUICtrlRead($InputCustomerEmailAdd) $output4 = GUICtrlRead($CustomerNumber) & GUICtrlRead($PrimaryNumber & $SecondaryNumber) $output5 = GUICtrlRead($PlanPurchased) & GUICtrlRead($SelectPlan) $output6 = GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) $output7 = GUICtrlRead($OperatingSystem) & GUICtrlRead($SelectOperatingSystem) $output8 = GUICtrlRead($ComputersSignedUp) & GUICtrlRead($Checkbox1) $output9 = GUICtrlRead($TotalAmountPaid) & GUICtrlRead($InputAmountPaid) ClipPut($output) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output2) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output3) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output4) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output5) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output6) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output7) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output8) ConsoleWrite(ClipGet() & @CRLF) ClipPut($output9) ConsoleWrite(ClipGet() & @CRLF) EndSwitch WEnd Link to comment Share on other sites More sharing options...
nitekram Posted May 1, 2015 Share Posted May 1, 2015 Try this instead:$output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF $output &= GUICtrlRead($CustomerNumber) & ' ' & GUICtrlRead($PrimaryNumber & $SecondaryNumber) & @CRLF $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF $output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($Checkbox1) & @CRLF $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid) ClipPut($output) ConsoleWrite(ClipGet() & @CRLF) 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 1, 2015 Author Share Posted May 1, 2015 Okay everything is working perfectly, just one thing i have to work on and i'm not sure on how to do it i have 3 check boxes and i'm trying to have it read either or so if it reads 1 pc it gets that info or if its checked for 2 pc etc$output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($Checkbox1) & @CRLFI even tried the following commands$output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($Checkbox1), GUICtrlRead($Checkbox2), GUICtrlRead($Checkbox3) & @CRLF $output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($Checkbox1 & ' ' & $Checkbox2 & ' ' & $Checkbox3) & @CRLFI'm at a lossexpandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\Vince S\Documents\Form2.kxf $Form2 = GUICreate("Form1", 820, 738, 801, 93) $SalesAgentName = GUICtrlCreateLabel("Sales Agent Name: ", 56, 8, 124, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $InputAgentName = GUICtrlCreateInput("", 8, 32, 249, 21) $CustomerFullName = GUICtrlCreateLabel("Customer Full Name: ", 48, 64, 140, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $InputCustomerName = GUICtrlCreateInput("", 8, 88, 249, 21) $CustomerEmailAdd = GUICtrlCreateLabel("Customer E-Mail Address: ", 32, 120, 177, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $InputCustomerEmailAdd = GUICtrlCreateInput("", 8, 144, 249, 21) $CustomerNumber = GUICtrlCreateLabel("Customer Phone Number: ", 48, 176, 171, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $PrimaryNumber = GUICtrlCreateLabel("Primary: ", 48, 208, 38, 17) $SecondaryNumber = GUICtrlCreateLabel("Secondary: ", 168, 208, 55, 17) $InputCustomerPNumber = GUICtrlCreateInput("", 8, 224, 121, 21) $InputCustomerSNumber = GUICtrlCreateInput("", 136, 224, 121, 21) $PlanPurchased = GUICtrlCreateLabel("Plan Purchased: ", 80, 256, 104, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $SelectPlan = GUICtrlCreateCombo("", 8, 280, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only") $softwarepurchased = GUICtrlCreateLabel("Software Purchased: ", 72, 312, 132, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $SelectSoftware = GUICtrlCreateCombo("", 8, 336, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased") $OperatingSystem = GUICtrlCreateLabel("Operating System: ", 80, 368, 121, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $SelectOperatingSystem = GUICtrlCreateCombo("", 8, 392, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Windows|MAC") $ComputersSignedUp = GUICtrlCreateLabel("Computers Signed Up: ", 64, 424, 148, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $Checkbox1 = GUICtrlCreateCheckbox("1 PC", 40, 456, 49, 17) $Checkbox2 = GUICtrlCreateCheckbox("2 PC", 120, 456, 49, 17) $Checkbox3 = GUICtrlCreateCheckbox("3 PC", 192, 456, 49, 17) $TotalAmountPaid = GUICtrlCreateLabel("Total Amount Paid: ", 80, 488, 126, 21) GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman") $InputAmountPaid = GUICtrlCreateInput("$", 80, 520, 121, 21) $CopyNotes = GUICtrlCreateButton("Copy Notes", 8, 560, 91, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Link to comment Share on other sites More sharing options...
nitekram Posted May 1, 2015 Share Posted May 1, 2015 I am not at a computer, but look at examples for radiobuttons - unless you want more than one checked. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 1, 2015 Author Share Posted May 1, 2015 well there will only be one checked at a time it's either 1 pc or 2 pc or 3 pc as i have 3 difference check boxes, yeah i've been testing out different theories and testing everything Link to comment Share on other sites More sharing options...
nitekram Posted May 1, 2015 Share Posted May 1, 2015 (edited) Go with radio button then, as otherwise you will not know which checkbox is the one wanted, as more than one can be checked, with radio, only one can be in a set. Edited May 1, 2015 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 1, 2015 Author Share Posted May 1, 2015 okay that makes sense am i writing the code correctly for this$output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($SelectPC1) & GUICtrlRead($SelectPC2) & @CRLF Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 11, 2015 Author Share Posted May 11, 2015 Hey all still having problems with this, will any be able to give me an update status on it Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 11, 2015 Author Share Posted May 11, 2015 I have the following code i've been working on however it is not reading rightthe resutls are coming up as follows Computers Signed Up 4 (this is what happens when i select the radio selection for pc 2 or pc 3 expandcollapse popup$SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17) $SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17) $SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $CopyNotes $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF $output &= GUICtrlRead($ComputersSignedUp) & ' ' & GUICtrlRead($SelectPC1) & @CRLF $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid) ClipPut($output) ConsoleWrite(ClipGet() & @CRLF) Case $SelectPC1 If GUICtrlRead($SelectPC1) = 1 Then EndIf Case $SelectPC2 If GUICtrlRead($SelectPC2) = 2 Then EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 11, 2015 Moderators Share Posted May 11, 2015 You need to re-read the help file for GUICtrlRead; for a RadioButton, it reads the STATE of the button (1 for $GUI_CHECKED, 4 for $GUI_UNCHECKED). Just because you assign a label 1, 2, 3 to your radio buttons doesn't mean that label will be read. You need to work that into your logic. Something like this:If GUICtrlRead($SelectPC1) = 1 Then ConsoleWrite("You selected radio button 1!" & @CRLF) ElseIf GUICtrlRead($SelectPC2) = 1 Then ConsoleWrite("You selected radio button 2!" & @CRLF) ElseIf GUICtrlRead($SelectPC3) = 1 Then ConsoleWrite("You selected radio button 3!" & @CRLF) Else ConsoleWrite("Error! No radio buttons selected!" & @CRLF) EndIf "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
tattoofreak87 Posted May 11, 2015 Author Share Posted May 11, 2015 Is there any way i can make that code into this formatI want to be able to select 1 pc and then have it out put to the output field for computers signed upsame with 2pc and 3 pc Sales Agent NameCustomer Full NameCustomer E-Mail AddressPrimarySecondaryPlan PurchasedSoftware PurchasedOperating SystemComputers Signed Up 1Total Amount Paid $ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 11, 2015 Moderators Share Posted May 11, 2015 If GUICtrlRead($SelectPC1) = 1 Then $PCsPurchased = 1 ElseIf GUICtrlRead($SelectPC2) = 1 Then $PCsPurchased = 2 ElseIf GUICtrlRead($SelectPC3) = 1 Then $PCsPurchased = 3 Else ConsoleWrite("Error! No radio buttons selected!" & @CRLF) EndIf $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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