Sign in to follow this  
Followers 0
ericg32

GUICTRL...

8 posts in this topic

WHen I have the following:

$user = GUICtrlCreateInput ("User Name", 10, 10, 60, 20)

$radio1 = GUICtrlCreateRadio ("Data Tracking", 10, 40, 120, 20)

$radio2 = GUICtrlCreateRadio ("User Profile ", 10, 70, 120, 20)

I get the following

----------------

___________

|__________|

Data Tracking 0

User Profile X (box filleed in)

Where is the text for the INPUT ? Shouldn;'t User Name be displayed >?

Share this post


Link to post
Share on other sites

Sometimes it's hard to be clear.. I get the box to enter the value for "USer Name" but I don't get the text "User Name" next to it..so the user knows what to enter. I DO see "Dta Tracking" and "User Profile: on the left side of the radio buttons.

Share this post


Link to post
Share on other sites

If it helps.. here is the entire code..

#include <GUIConstants.au3>

$CFile = FileOpen ( "c:\autoit\config.fil", 0 )

$Username = FileReadLine($CFile)

$PW = FileReadline($CFile)

FileClose($CFile)

$TODO = 0

GUICreate("Get RUN Info") ; will create a dialog box that when displayed is centered

$user = GUICtrlCreateInput ("User Number", 10, 10, 60, 20)

$radio1 = GUICtrlCreateRadio ("Data Tracking", 10, 40, 120, 20)

$radio2 = GUICtrlCreateRadio ("User Profile ", 10, 70, 120, 20)

GUICtrlSetState ($radio1, $GUI_CHECKED)

GUISetState () ; will display a dialog box with 1 checkbox

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED

$TODO = 1

$userno = GUICtrlRead($user)

ExitLoop

Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED

$TODO = 2

$userno = GUICtrlRead($user)

ExitLoop

EndSelect

Wend

GUIDelete()

run ("C:\Program Files\Internet Explorer\IEXPLORE.EXE mysite")

sleep(1000)

opt("WinTitleMatchMode",2)

WinWaitActive("Interchange Services")

sleep(1000)

send($Username)

send("{tab}")

send($PW)

send("{enter}")

SLEEP(2000)

IF $TODO = 1 Then

Mouseclick("left",9,227)

mouseclick("left",38,271)

EndIf

IF $TODO = 2 Then

mouseclick("left",9,291)

MouseClick("LEFT",47,316)

EndIf

sleep(1000)

send($userno)

SEND("{ENTER}")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

GUICtrlCreateInput("Text",left,top...)

It won't show "User Name" by the inputbox, it will show it inside the inputbox.

Use labels.

#include <GUIConstants.au3>

$CFile = FileOpen ( "c:\autoit\config.fil", 0 )
$Username = FileReadLine($CFile)
$PW = FileReadline($CFile)
FileClose($CFile)

$TODO = 0

GUICreate("Get RUN Info") ; will create a dialog box that when displayed is centered
GUICtrlCreateLabel("User Name", 10, 10, 60, 20)
$user = GUICtrlCreateInput ("", 70, 10, 60, 20)
$radio1 = GUICtrlCreateRadio ("Data Tracking", 10, 40, 120, 20)
$radio2 = GUICtrlCreateRadio ("User Profile ", 10, 70, 120, 20)
GUICtrlSetState ($radio1, $GUI_CHECKED)

GUISetState () ; will display a dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
$TODO = 1
$userno = GUICtrlRead($user)
ExitLoop
Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
$TODO = 2
$userno = GUICtrlRead($user)
ExitLoop
EndSelect
Wend
GUIDelete()

run ("C:\Program Files\Internet Explorer\IEXPLORE.EXE mysite")

sleep(1000)
opt("WinTitleMatchMode",2)
WinWaitActive("Interchange Services")
sleep(1000)

send($Username)
send("{tab}")
send($PW)
send("{enter}")
SLEEP(2000)

IF $TODO = 1 Then
Mouseclick("left",9,227)
mouseclick("left",38,271)
EndIf
IF $TODO = 2 Then
mouseclick("left",9,291)
MouseClick("LEFT",47,316)
EndIf
sleep(1000)
send($userno)
SEND("{ENTER}")
Edited by Nahuel

Share this post


Link to post
Share on other sites

Always the simple things. I searched for a lot of words... "labels" didn't come to mind.

THNX

Share this post


Link to post
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
Sign in to follow this  
Followers 0