Sign in to follow this  
Followers 0
JohnBailey

GUI OnEvent problem

3 posts in this topic

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

Share this post


Link to post
Share on other sites



xcal, geeze I guess I was overlooking the smallest things last night! Thanks as always :whistle:


A decision is a powerful thing

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