Sign in to follow this  
Followers 0
LoWang

get an event set for a gui control

3 posts in this topic

Hello, I wonder if there is a way to get which function is set to a control by guictrlsetonevent. I have a project in progress and I frequently test some new functions via buttons. I would just like to have those buttons name themselves automatically according to which function is assigned to them.

Thank you

Share this post


Link to post
Share on other sites



I am not aware of a way to do it after the fact. I assume by button names that you mean the captions. You should be able to set those at the same time as you assign the function to the button event. You might even create a function that does both steps for you.

Func _SetButton($ButtonHandle, $ButtonFunction)
    GUICtrlSetOnEvent($ButtonHandle, $ButtonFunction) ; assigns the function
    GUICtrlSetData($ButtonHandle, $ButtonFunction) ; names button to match function name
EndFunc

Share this post


Link to post
Share on other sites

I thought so... thanks

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