You are on the right track. The UI is available through the instantiated
version, when you inherit directly from a control. Create your inherited
class in a separate control library, which compiles to a dll. From the
Toolbox, you can add the dll, which will be in the bin folder of the project.
The control library should show its controls as checked, as you add it in.
Remember to set a reference to your controls library inside your exe project.
You can override OnCreateControl, in your inherited control. It acts like a
Load event. You can prompt a read of default properties there.
Protected Overrides Sub OnCreateControl()
MyBase.Text = Me.Text
MyBase.OnCreateControl()
End Sub
You can set default properties as follows.
Private _Text As String = "New Text"
Public Shadows Property Text() As String
Get
Return Me._Text
End Get
Set(ByVal Value As String)
Me._Text = Value
End Set
End Property
When you instantiate the control on a form from the Toolbox, the properties
will be available just as they would for a standard Textbox.
www.charlesfarriersoftware.com
"Antuane" wrote:
i'm trying to create a custom textbox class, by simply creating a new class
& inheriting from the textbox class.
But i don't have a UI of this class.
I.e., how can i set up the default text, color for this text box - via the
properties window if there is no UI.
Currently i'm doing this via code & this is a headache, cuz i've got to drop
this control onto a form & then check out whether my UI changes are as
required.
Is there a way for me to see this custom class UI while in design mode.
Just as i creat a custom Form, i can inherit from a existing windows form &
see the UI....