Jump to content

possable to make custom buttons?


Dead_Man
 Share

Recommended Posts

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 117, 37, 192, 125)
$Button1 = GUICtrlCreateButton("Notepad", 0, 0, 116, 36)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $Button1
            Run("notepad.exe")
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
    EndSelect
WEnd
Exit

Link to comment
Share on other sites

you can use events too, like in vb:

#include <GUIConstants.au3>

Opt("GUIOnEventMode",1) ;this is the opt to use events
$frmTest = GUICreate("My Form", 415, 307, 292, 192)
$button = GUICtrlCreateButton("Run Notepad", 145, 120, 106, 31, 0)
GUICtrlSetOnEvent($button, "buttonclick")  ;this set a event named "buttonclick" for object $button
;you can use "GuiCtrlSetOnEvent(-1, "buttonclick")" too
GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd
        
Func buttonclick()
    run("notepad.exe")
EndFunc
Edited by gring0

Never judge my awesome brazilian-english language :D:D<-- lol ;P

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