Jump to content

Noob help with some simple gui code


Recommended Posts

Hello all im a new user to the gui part of autoit....i have a few questions and i was hoping that you all might be able to help me out with. what i am trying to do is create a gui with a few variables that are input feilds adn then call the variable later...just playing with the gui stuff, trying to figure it all out...anyway here is my code that im working with:

#include <GUIConstants.au3>
#include <Date.au3>

GUICreate("Keith's GUI") ; will create a dialog box that when displayed is centered

$Button_1 = GUICtrlCreateButton ("Test",  150, 25, 100)

GUICtrlCreateLabel("SR", 26, 28)
$casetype=GUICtrlCreateCombo("", 45, 25, 37)
    GUICtrlSetData(-1,"Z|Q|S|X", "X")
$casenumber=GUICtrlCreateInput("", 85, 25, 50)

GUISetState (@SW_SHOW)    ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select 
    Case $msg=$GUI_EVENT_CLOSE
            ExitLoop
        Case $msg=$button_1
            MsgBox(4096, "Test", "SR"&$casetype&@MON&@MDAY&$casenumber, 10);, 80, 80, 300)
    EndSelect
    
Wend

now what i should get is SR(either x, s, q, or z based on the values in the drop down box)0801 (the date of today)and then some random number from the input box. what im getting is sr50801 thats it...can someone help me with this

thanks in advanced...

Dezypher

Link to comment
Share on other sites

Hello all im a new user to the gui part of autoit....i have a few questions and i was hoping that you all might be able to help me out with. what i am trying to do is create a gui with a few variables that are input feilds adn then call the variable later...just playing with the gui stuff, trying to figure it all out...anyway here is my code that im working with:

#include <GUIConstants.au3>
#include <Date.au3>

GUICreate("Keith's GUI"); will create a dialog box that when displayed is centered

$Button_1 = GUICtrlCreateButton ("Test",  150, 25, 100)

GUICtrlCreateLabel("SR", 26, 28)
$casetype=GUICtrlCreateCombo("", 45, 25, 37)
    GUICtrlSetData(-1,"Z|Q|S|X", "X")
$casenumber=GUICtrlCreateInput("", 85, 25, 50)

GUISetState (@SW_SHOW)   ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select 
    Case $msg=$GUI_EVENT_CLOSE
            ExitLoop
        Case $msg=$button_1
            MsgBox(4096, "Test", "SR"&$casetype&@MON&@MDAY&$casenumber, 10);, 80, 80, 300)
    EndSelect
    
Wend

now what i should get is SR(either x, s, q, or z based on the values in the drop down box)0801 (the date of today)and then some random number from the input box. what im getting is sr50801 thats it...can someone help me with this

thanks in advanced...

Dezypher

$casetype and $casenumber are the numerical identifications for the controls themselves, they are not the values that the controls are displaying or have selected.

You need GuiCtrlRead($cas...), Have a look in the help because the way GuCtrlRead works depends on the control type.

It's the same as setting the data where you have used GuiCtrlSetData and not $case.. = something.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

$casetype and $casenumber are the numerical identifications for the controls themselves, they are not the values that the controls are displaying or have selected.

You need GuiCtrlRead($cas...), Have a look in the help because the way GuCtrlRead works depends on the control type.

It's the same as setting the data where you have used GuiCtrlSetData and not $case.. = something.

Thank you so much for the help...I have figured out where i needed to make the changes :)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...