Jump to content

get an event set for a gui control


LoWang
 Share

Recommended Posts

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

Link to comment
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
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...