Sign in to follow this  
Followers 0
Wikipete

GUI Multiple Buttons

2 posts in this topic

Hi. I am using Autoit to build a reasonably simple GUI.

I have set up one button how I want it but am unsure how to set up the others I have searched the help files and there's nothing that jumped out at me as being able to help me.

;-----------------------INSTALL PROGRAMS---------------------------
$installprograms = GUICtrlCreateMenu ("&Install Programs")
$installprogramsitem = GUICtrlCreateMenuitem ("Run",$installprograms)
GUICtrlSetState(-1,$GUI_DEFBUTTON)
;--------------------------------------------------------------
$autoitmenu = GUICtrlCreateMenu ("&Auto-it")
$runautoittutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$autoitmenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Wn-y")
$runwinspytutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$filemenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Macro-R")
$runmacrotutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$filemenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Useful Items")
$fourm = GUICtrlCreateMenuitem ("&AutoIt Forum",$filemenu)
$paint = GUICtrlCreateMenuitem ("MS &Paint",$filemenu)
$notepad = GUICtrlCreateMenuitem ("MS &Notepad",$filemenu)
;-------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Help")
$runautoittutorial = GUICtrlCreateMenuitem ("Help &Software",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("Macrolism &Website",$filemenu)oÝ÷ Ù8h±æ«y©e¶ºÛhÇè®lP!j÷¬zÛ©¶­¢'yÊ+­ç-&®Ë«z0¶¶êmêÞ²ÑÞ­è¬Â­"¯yÚ'y«­¢+Øì´´´´´´´´´´´´´´´´´´´´´´´´µ%9MQ10AI=I5L´´´´´´´´´´´´´´´´´´´´´´´´´)]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØí¥¹Íѱ±ÁɽɵͥѴ(%IÕ¸ ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈíµ¥¸ÀäÈíͭѽÀÀäÈíAɽɴ¥±ÌÀäÈíAɽɴ1½P¹áÅÕ½Ðì¤($á¥Ñ1½½À($(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ñ1½½À(¹M±Ð)]¹)á¥Ð(ì´´´´´´´´´´´´´´´´´´´´´´´´µUQ=%P´´´´´´´´´´´´´´´´´´´´´´´´´)]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØíÉÕ¹Õѽ¥ÑÑÕѽɥ°(%IÕ¸ ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈíµ¥¸ÀäÈíͭѽÀÀäÈíAɽɴ¥±ÌÀäÈíAɽɴ1½P¹áÅÕ½Ðì¤($á¥Ñ1½½À($
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ñ1½½À(¹M±Ð)]¹

So in simple terms I am asking, what is the best way to set up multiple buttons?!

Thanks.


 Run (Brain.exe)
.

Share this post


Link to post
Share on other sites



Hi. I am using Autoit to build a reasonably simple GUI.

I have set up one button how I want it but am unsure how to set up the others I have searched the help files and there's nothing that jumped out at me as being able to help me.

;-----------------------INSTALL PROGRAMS---------------------------
$installprograms = GUICtrlCreateMenu ("&Install Programs")
$installprogramsitem = GUICtrlCreateMenuitem ("Run",$installprograms)
GUICtrlSetState(-1,$GUI_DEFBUTTON)
;--------------------------------------------------------------
$autoitmenu = GUICtrlCreateMenu ("&Auto-it")
$runautoittutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$autoitmenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Wn-y")
$runwinspytutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$filemenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Macro-R")
$runmacrotutorial = GUICtrlCreateMenuitem ("&Run Tutorial",$filemenu)
$aboutautoit = GUICtrlCreateMenuitem ("&About",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("&Official Website",$filemenu)
;--------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Useful Items")
$fourm = GUICtrlCreateMenuitem ("&AutoIt Forum",$filemenu)
$paint = GUICtrlCreateMenuitem ("MS &Paint",$filemenu)
$notepad = GUICtrlCreateMenuitem ("MS &Notepad",$filemenu)
;-------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&Help")
$runautoittutorial = GUICtrlCreateMenuitem ("Help &Software",$filemenu)
$autoitwebsite = GUICtrlCreateMenuitem ("Macrolism &Website",$filemenu)&Website",$filemenu)oÝ÷ Ù«­¢+Øì´´´´´´´´´´´´´´´´´´´´´´´´µ%9MQ10AI=I5L´´´´´´´´´´´´´´´´´´´´´´´´´)]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØí¥¹Íѱ±ÁɽɵͥѴ(IÕ¸ ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈíµ¥¸ÀäÈíͭѽÀÀäÈíAɽɴ¥±ÌÀäÈíAɽɴ1½P¹áÅÕ½Ðì¤(á¥Ñ1½½À((
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ñ1½½À(¹M±Ð)]¹)á¥Ð(ì´´´´´´´´´´´´´´´´´´´´´´´´µUQ=%P´´´´´´´´´´´´´´´´´´´´´´´´´)]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØíÉÕ¹Õѽ¥ÑÑÕѽɥ°(IÕ¸ ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈíµ¥¸ÀäÈíͭѽÀÀäÈíAɽɴ¥±ÌÀäÈíAɽɴ1½P¹áÅÕ½Ðì¤(á¥Ñ1½½À(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ñ1½½À(¹M±Ð)]¹

So in simple terms I am asking, what is the best way to set up multiple buttons?!

Thanks.

You've lost me there because you haven't created any buttons. You mean menu items I suppose.

I don't understand why you have 2 while loops either.

To respond to other menu items you need to add more Case lines in the Select loop.

Off subject

The AutoIt tags are a pain in the backside as far as I'm concerned. To get your code to appear when I replied I had to copy and paste from your post otherwise there was just a jumble of meaningless rubbish. I recommend that noone ever uses AutoIt tags again. Better still I recommend that the AutoIt tag option is removed from the face of the website and then thrown into an active volcano. I have never seen a problem with code tags so in my opinion they're the ones to use. In fact I'm going to change my signature to advertise my profound dislike of them.


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.

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