Get object name

  • Thread starter Thread starter Rob Willaar
  • Start date Start date
R

Rob Willaar

Hi all,

Can i get the Name of a menu object in the Click event handler?

tnx for any help
 
Hi all,

Can i get the Name of a menu object in the Click event handler?

tnx for any help

Yes... Cast the sender to MenuItem and you can access the name
property.
 
Tnx for your reply Tom

A MenuItem does not have a name property.

I try this:
Dim x As MenuItem

x = CType(sender, MenuItem)

x does not have a name property...

Because i'm building a multilingual app i can't use the text property..
 
Tom,

Tom Shelton said:
Yes... Cast the sender to MenuItem and you can access the name
property.

'MenuItem' doesn't have a 'Name' property ;-).
 
Hi all,

Can i get the Name of a menu object in the Click event handler?

tnx for any help

Sorry, about my last answer... I answered without thinking. I can't see
anyway to get the name of the object. So, the only things I can think
todo are 1) make sure each menuitem has it's own click event - then you
know what item for sure clicked it. 2) try to make use of the menuitems
index property 3) inherit from menuitem and create your own class.

None seem ideal really...
 
I have never done this before but i cound create a new menuitem and add a
tag property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top