LoWang Posted December 28, 2011 Share Posted December 28, 2011 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 More sharing options...
willichan Posted December 28, 2011 Share Posted December 28, 2011 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 My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
LoWang Posted December 29, 2011 Author Share Posted December 29, 2011 I thought so... thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now