LOFRANK Posted June 11, 2004 Posted June 11, 2004 HI! i have a function that store in a database the control names of my application, i need a simple code that retrieve the control name of all the objects that i pass 2 this function. Problems are when for example i pass a toolbarbutton, that dont appear to have the name property, so how i can get the name in this particular case? Function name(cont as object) as string return (cont.name) end function example code: msgbox(Toolbar1.Buttons(0)) ' this give an error , property not found in the function thnk you for attenction Quote live any day of your life like your last.
Administrators PlausiblyDamp Posted June 11, 2004 Administrators Posted June 11, 2004 Toolbar buttons don't have a name property so there is no way to retrieve it through code. Also as you will be only passing controls into the function you would be better of strongly typing the parameter. i.e. Function name(cont as Control) as string return (cont.name) end function saying that the function itself seems a bit un-needed - is there any reason why you can't just refer to the control's name property in the first place? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
LOFRANK Posted June 11, 2004 Author Posted June 11, 2004 cause i use an external module for that kind of function. anyway: ctype(bytoolbarbutton,Control).Name BUT this return always a string like:"ToolbarButton" Anyway i can't change the name in my Software for have a good visual refecrence about the Toolbarbuttons in my archive. Thnk you Quote live any day of your life like your last.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.