Jump to content

AutoIt CodeBox.


AzKay
 Share

Recommended Posts

Try [ codebox][ autoit] ........ [ /autoit][ /codebox] example below.

CODE
#include <GUIConstants.au3>

GUICreate("My GUICtrlRead") ; will create a dialog box that when displayed is centered

$menu1  = GUICtrlCreateMenu("File")

$n1     = GUICtrlCreateList("", 10, 10, -1, 100)
GUICtrlSetData(-1, "item1|item2|item3", "item2")

$n2     = GUICtrlCreateButton("Read", 10, 100, 50)
GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState () ; will display an empty dialog box
; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
    if $msg = $n2 Then
        Msgbox(0, "Selected listbox entry", GUICtrlRead($n1)) ; display the selected listbox entry
        $menustate  = GUICtrlRead($menu1) ; return the state of the menu item
        $menutext   = GUICtrlRead($menu1, 1) ; return the text of the menu item
        Msgbox(0, "State and text of the menuitem", "state:" & $menustate & @LF & "text:" & $menutext)
    EndIf
Until $msg = $GUI_EVENT_CLOSE


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I wish those codebox's would have a select all function. Something like the select link they use over at www.frebasic.net/forum. It would make it so much easier to copy code you want to try out.;)

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