PC Review


Reply
Thread Tools Rate Thread

Custom Control Instance Name

 
 
BluDog
Guest
Posts: n/a
 
      7th Jul 2004
Hi

I have a custom control that displays text, I am trying to work out
how to access the name of the instance of the control to display at
design time (similar to TextBox). The name property returns the
Control name rather than the instance e.g. MyControl rather than
MyControl1.

Any ideas?

Thanks

Blu.
 
Reply With Quote
 
 
 
 
One Handed Man \( OHM - Terry Burns \)
Guest
Posts: n/a
 
      7th Jul 2004
Me.GetType.ToString ?



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"BluDog" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I have a custom control that displays text, I am trying to work out
> how to access the name of the instance of the control to display at
> design time (similar to TextBox). The name property returns the
> Control name rather than the instance e.g. MyControl rather than
> MyControl1.
>
> Any ideas?
>
> Thanks
>
> Blu.



 
Reply With Quote
 
One Handed Man \( OHM - Terry Burns \)
Guest
Posts: n/a
 
      7th Jul 2004
Sorry, read you wrong, you wanted the Instance not the Control Type.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"BluDog" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I have a custom control that displays text, I am trying to work out
> how to access the name of the instance of the control to display at
> design time (similar to TextBox). The name property returns the
> Control name rather than the instance e.g. MyControl rather than
> MyControl1.
>
> Any ideas?
>
> Thanks
>
> Blu.



 
Reply With Quote
 
Michael Maes
Guest
Posts: n/a
 
      7th Jul 2004
"IComponentChangeService" could help you (ce.OldName / ce.NewName)
(have a look at my reply to "Re: How to get a usercontrol to automatically add code to the initialization code in a form...")

"Reflection" could also be an option.
(have a look at my reply to "Re: Reflection...")



Michael


"BluDog" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi
>
> I have a custom control that displays text, I am trying to work out
> how to access the name of the instance of the control to display at
> design time (similar to TextBox). The name property returns the
> Control name rather than the instance e.g. MyControl rather than
> MyControl1.
>
> Any ideas?
>
> Thanks
>
> Blu.

 
Reply With Quote
 
BluDog
Guest
Posts: n/a
 
      7th Jul 2004
>"IComponentChangeService" could help you (ce.OldName / ce.NewName)
>(have a look at my reply to "Re: How to get a usercontrol to automatically add code to the initialization code in a form...")
>
>"Reflection" could also be an option.
>(have a look at my reply to "Re: Reflection...")


Thanks, the thing that interests me about this problem is the fact
that when the custom control is added to the form the automatic name
(e.g. MyControl1) is added correctly, as with any other form, however
the Name property of the control returns the Type Name rather than the
control instance name...

Cheers

Blu
 
Reply With Quote
 
One Handed Man \( OHM - Terry Burns \)
Guest
Posts: n/a
 
      7th Jul 2004
Have you tried this in C# ?, maybe its a bug

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"BluDog" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >"IComponentChangeService" could help you (ce.OldName / ce.NewName)
> >(have a look at my reply to "Re: How to get a usercontrol to

automatically add code to the initialization code in a form...")
> >
> >"Reflection" could also be an option.
> >(have a look at my reply to "Re: Reflection...")

>
> Thanks, the thing that interests me about this problem is the fact
> that when the custom control is added to the form the automatic name
> (e.g. MyControl1) is added correctly, as with any other form, however
> the Name property of the control returns the Type Name rather than the
> control instance name...
>
> Cheers
>
> Blu



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
workflow: custom object instance as a parameter or property in custom activity Bandu Microsoft Dot NET Framework 0 2nd Sep 2007 07:41 PM
workflow: custom object instance as a parameter or property in custom activity Bandu Microsoft C# .NET 0 1st Sep 2007 07:16 PM
using control properties/methods of AxHost control instance =?Utf-8?B?eW9nYSB3ZWF6ZWw=?= Microsoft Dot NET Framework Forms 0 19th Apr 2006 04:25 PM
creating an instance of a custom control in xslt? Josh Wolf Microsoft ASP .NET 0 16th Mar 2006 06:57 PM
Refreshing a custom user control instance Do Microsoft ASP .NET 0 29th Oct 2003 05:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:55 AM.