Sign in to follow this  
Followers 0
Xoenix

GUI Building Help

6 posts in this topic

I have my functions and everything, but I just cant seem to get the GUI under control.

I was just a box, with 2 different buttons, one saying on, other off.

It would be good if I could be able to load a picture as background to.

Thanks heaps for the help! ;)

Share this post


Link to post
Share on other sites



#include <GuiConstants.au3>

GuiCreate("My Switch", 348, 223, 366,266)

$n = GUICtrlCreatePic(@Systemdir & "\oobe\images\wpakey.jpg",0,0, 366,266)

GuiCtrlSetState($n, $GUI_DISABLE)

$Button1 = GuiCtrlCreateButton("On", 80, 72, 57, 33)

$Button2 = GuiCtrlCreateButton("Off", 200, 72, 57, 33)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Button1 ;On Button

MsgBox(0, "", "You press On button.")

Case $msg = $Button2 ;Off Button

MsgBox(0, "", "You press Off button")

Case Else

;;;

EndSelect

WEnd

Exit

I hope this will help you....


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Thanks :P

I think I can get the rest from here ;)

If I have problems I'll ask again.

Share this post


Link to post
Share on other sites

Sorry for double post, but how do I a) addd more buttons :P make buttons wider to fit more text?

Appreciated ;)

Share this post


Link to post
Share on other sites

Sorry for double post, but how do I a) addd more buttons :P make buttons wider to fit more text?

Appreciated ;)

<{POST_SNAPBACK}>

To add more button you can use:

$Button# = GUICtrlCreateButton ( "text", left, top [, width [, height [, style [, exStyle]]]] )

where # will be 3, 4, 5, 6, ....

GuiCtrlCreateButton create the button that you want

"text" inside the quots the message that you want

and then play with the coordenants

left is equal X

top is equal Y

width and height so you can fit more text

for the style and exStyle you will have to look at the help file the are too many.....


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

you should download Scite4AutoIt

it has a great guibuilder.. you just drag and drop


[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

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