Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

live any day of your life like your last.
  • Administrators
Posted

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?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

live any day of your life like your last.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...