Jump to content

GUI OnEvent problem


Recommended Posts

If I use onEvent for the gui then how do I use buttons too?

I tried the following and looked through the manual, but no "dice"

Opt("TrayIconDebug", 1)
Opt("GUIOnEventMode", 1)
TrayTip("ImageRenamer", "Automatically renames jpgs v1.0", 10, 1)
#NoTrayIcon
#include <Array.au3>
#include <File.au3>
#include <GUIConstants.au3>
#include <GuiList.au3>
$Form1 = GUICreate("Image Renamer", 403, 510, 210, 172)
$bRename = GUICtrlCreateButton("Rename", 160, 104, 81, 17, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")
GUISetOnEvent($bRename, "rAct")
GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd


Func rAct()
    MsgBox(0,"Dialog","Rename clicked")
EndFunc

Func close()
    Exit
EndFunc
A decision is a powerful thing
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...