Help with Inheriting a TextBox Winforms Control 
Author Message
 Help with Inheriting a TextBox Winforms Control

I have sub-classed (inherited from) a Winforms Textbox control.

In my class module, I created a Public Enumeration called MyFieldTypes, and
added a new property procedure to set/get the privately declared variable.

When my control is dropped onto the Form, the FieldType property is visible
in the IDE Properties window, and an enum can be selected.

HERE is the problem.  After an enum value for that property has been
selected, and the form has been closed, the form cannot be re-opened.  I get
the following error at Microsoft.VisualStudio.Designer.Host.Designer
Host.Load(Boolean reloading) ...(blah blah blah):

"Could not find type 'MyTextBox.MyFieldTypes'.  Please make sure that the
assembly that contains this type is referenced.  If this type is a part of
your development project, make sure that the project has been successfully

Why can't the form find the Enum in the Class?

Here is the code below:

Public Enum MyFieldTypes
    ftText = 0
    ftNumeric = 1
End Enum

Private mFieldType as MyFieldTypes

Public Property FieldType() As MyFieldTypes
        Return mFieldType
    End Get

            mFieldType = Value
        End Set
End Property

and a new Property Procedure called MyFieldType

In my class I added a property procedure (Set/Get) called FieldType.

Sun, 19 Oct 2003 03:52:16 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Inheriting TextBox control

2. Custom Painting in an inherited textbox control

3. Need to format textbox content in winforms project

4. Is textbox data binding one way in winforms?

5. Inheriting a textbox

6. Strange behavior with UserControl that inherits from TextBox

7. Inherits - Whats the difference between Form.Textbox and Form.TextboxBase

8. inherit from textbox

9. inherit from winform.textbox

10. Controls Inheriting Other Control's Properties

11. Controls Inheriting Other Control's Properties

12. Controls Inheriting Other Control's Properties


Powered by phpBB® Forum Software