Jump to content

Help with creating buttons


Recommended Posts

Hi,

I'm wondering if anyone can point me in the right direction on accomplishing the second step below:

- create a button using GUICtrlCreateButton

- When you select the button created above, have a list of secondary buttons for lack of a better term displayed (similar to how you achieve this with TrayCreateItem).

Thanks!

(First time poster...please advise if this should be directed somewhere else).

Link to comment
Share on other sites

Hi Volly,

I've read the help file and have been using AutoIT for about two years but don't seem to be finding anything related to how i'd accomplish the second step (I'm quite comfortable with creating the gui and creating buttons, but essentially I'm wondering if it's possible to achieve the second step. For example I'd like to create a button called "Control Panel" and once the user selects this a second list would display with Add/Remove, Display Properites, System, etc.

Any additional help/guidance is greatly appreciated.

Take AutoIt 1 2 3. It is in my signature. It will answer your question and you will learn much more.

Also, look at the helpfile ....

Link to comment
Share on other sites

  • Moderators

ampandey77,

A little hint:

#include <GUIConstantsEx.au3>

GUICreate("Test", 500, 500)

$hButton1 = GUICtrlCreateButton("Show", 10, 10, 80, 30)

$hButton_New1 = GUICtrlCreateButton("New 1", 100,  10, 80, 30)
$hButton_New2 = GUICtrlCreateButton("New 1", 100,  60, 80, 30)
$hButton_New3 = GUICtrlCreateButton("New 1", 100, 110, 80, 30)
$hButton_New4 = GUICtrlCreateButton("New 1", 100, 160, 80, 30)

For $i = $hButton_New1 To $hButton_New4
    GUICtrlSetState($i, $GUI_HIDE)
Next

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            For $i = $hButton_New1 To $hButton_New4
                GUICtrlSetState($i, $GUI_SHOW)
            Next
    EndSwitch

WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Perfect...that points me in the direction I wanted to go...now I just need to figure out having the secondary buttons display in a list vs. actual buttons.

Thanks again!

ampandey77,

A little hint:

#include <GUIConstantsEx.au3>

GUICreate("Test", 500, 500)

$hButton1 = GUICtrlCreateButton("Show", 10, 10, 80, 30)

$hButton_New1 = GUICtrlCreateButton("New 1", 100,  10, 80, 30)
$hButton_New2 = GUICtrlCreateButton("New 1", 100,  60, 80, 30)
$hButton_New3 = GUICtrlCreateButton("New 1", 100, 110, 80, 30)
$hButton_New4 = GUICtrlCreateButton("New 1", 100, 160, 80, 30)

For $i = $hButton_New1 To $hButton_New4
    GUICtrlSetState($i, $GUI_HIDE)
Next

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            For $i = $hButton_New1 To $hButton_New4
                GUICtrlSetState($i, $GUI_SHOW)
            Next
    EndSwitch

WEnd

M23

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...