Getting the name of an object 
Author Message
 Getting the name of an object

Hi,

I have created a usercontrol which acts as a simple slider. When
right-clicking on the slider a simple dialog appears from which you can
properties.

I have created a new solution and a new project, added the control in the
toolbox and dropped several onto a form.
I have then changed the names of these sliders. When I right-click on the
sliders I want the name of the slider of I right-clicked to appear as the
title of my dialog.
For example I have dropped 2 sliders onto a form and renamed them to
Slider_Vertical, Slider_Horizontal. When I right-click on Slider_Vertical
the dialog title I want to see is "Slider_Vertical Properties ".

Any ideas??



Tue, 26 Apr 2005 19:38:37 GMT  
 Getting the name of an object
I believe the Name property of your control will return the name of the
control to the form at least. I'm not sure if the control can retrieve it's
own name. Perhaps you could add an event to the control that is raised
before showing the name that would allow the form to return the controls
current name to it. Hope that helps.

Aaron
"My post is only an opinion and comes without a guarantee. Try at your own
risk!"


Quote:
> Hi,

> I have created a usercontrol which acts as a simple slider. When
> right-clicking on the slider a simple dialog appears from which you can
> properties.

> I have created a new solution and a new project, added the control in the
> toolbox and dropped several onto a form.
> I have then changed the names of these sliders. When I right-click on the
> sliders I want the name of the slider of I right-clicked to appear as the
> title of my dialog.
> For example I have dropped 2 sliders onto a form and renamed them to
> Slider_Vertical, Slider_Horizontal. When I right-click on Slider_Vertical
> the dialog title I want to see is "Slider_Vertical Properties ".

> Any ideas??



Wed, 27 Apr 2005 02:01:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting the name of an object in a array

2. (Q) Getting current Sub/Function name (or Object Browser functionality)

3. Getting the object name via reflection

4. Getting an objects class name

5. Getting table names without actually knowing their names...

6. getting users name and workstation name Urgent

7. Getting name from Domain Name Server in VB?

8. Getting short file name from long file name:

9. Getting the user's logon name and computer name

10. Getting table names without actually knowing their names...

11. Getting table names without actually knowing their names...

12. Getting table names without actually knowing their names...

 

 
Powered by phpBB® Forum Software