473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Get object name

Hi all,

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

tnx for any help

Nov 21 '05 #1
6 4436
On 2004-12-12, Rob Willaar <r.*******@xs4all.nl> wrote:
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.

--
Tom Shelton [MVP]
Nov 21 '05 #2
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 Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> schreef in bericht
news:ea**************@tk2msftngp13.phx.gbl...
On 2004-12-12, Rob Willaar <r.*******@xs4all.nl> wrote:
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.

--
Tom Shelton [MVP]

Nov 21 '05 #3
Tom,

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> schrieb:
Can i get the Name of a menu object in the Click event handler?


Yes... Cast the sender to MenuItem and you can access the name
property.


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

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #4
On 2004-12-12, Herfried K. Wagner [MVP] <hi***************@gmx.at> wrote:
Tom,

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> schrieb:
Can i get the Name of a menu object in the Click event handler?


Yes... Cast the sender to MenuItem and you can access the name
property.


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


Your right... Sorry.

--
Tom Shelton [MVP]
Nov 21 '05 #5
On 2004-12-12, Rob Willaar <r.*******@xs4all.nl> wrote:
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...

--
Tom Shelton [MVP]
Nov 21 '05 #6
I have never done this before but i cound create a new menuitem and add a
tag property.

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> schreef in bericht
news:u4****************@tk2msftngp13.phx.gbl...
On 2004-12-12, Rob Willaar <r.*******@xs4all.nl> wrote:
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...

--
Tom Shelton [MVP]

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
9
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
2
by: Aaron | last post by:
I have a data sructure setup and I populate it in a loop like so: y=0 while X: DS.name = "ASDF" DS.ID = 1234 list = DS; y = y + 1
5
by: Matthew | last post by:
I have a nice little Sub that saves data in a class "mySettings" to an XML file. I call it like so: Dim mySettings As mySettings = New mySettings mySettings.value1 = "someText" mySettings.value2...
16
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
11
by: Andrus | last post by:
I'm implementing entity object which should populate its properties from database when property is first referenced. In RDL reports I use object properties like MyObject.MyProperty MyObject...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.