Well, there's always the easy way ;-). Compile this into a Class Library
and you can use it w/ VB.NET or C#: Just create an instance of the
subclassed control and set ControlName as you create them. You can also
override the Name property but I just called it ControlName for the sake of
clarity.
using System;
using System.Data;
using System.Windows.Forms;
namespace ControlLib
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class NewTextBox: System.Windows.Forms.TextBox
{
private string _ControlName;
public string ControlName
{
get{return _ControlName;}
set{_ControlName = value;}
}
public NewTextBox(){}
public NewTextBox(string name)
{
this.ControlName = name;
}
}
}
--
W.G. Ryan, eMVP
Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups