Jump to content

GUI Building Help


Xoenix
 Share

Recommended Posts

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! ;)

Link to comment
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
Link to comment
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
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...