View Single Post
  #1 (permalink)  
Old 10-23-2008, 1:57 PM
dluxoh dluxoh is offline
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Oct 2008
Age: 70
Posts: 4
Reputation: 0
dluxoh is on a distinguished programming path ahead
Default custom controls not working with toolbox.

Hello I'm using VB.Net Express 2008 to write a program and want to make a custom control that inherits the TextBox class. I've done so successfully to a degree, but whats happening now is very frustrating.

I can successfully instanciate my new textbox using the following code in my main form:

Code:
Public Class SignBuilderForm
    Dim test As FormattedTextbox
    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        test = New FormattedTextbox
        test.Enabled = True
        test.Visible = True
        test.Parent = GroupBox1
        test.Width = 50

        ' Add any initialization after the InitializeComponent() call.

    End Sub
End Class
However, if I try to drag my component onto the form from the toolbox using the designer, I get errors once I save the project or try to build it.

Code:
Error    1    Type 'SignBuilderForm.FormattedTextbox' is not defined.
  C:\Documents and Settings\Administrator\Desktop\Gregs Projects\VBApps\SignBuilderForm\SignBuilderForm\SignBuilderForm.Designer.vb
  32    36    SignBuilderForm
Error    2    Type 'SignBuilderForm.FormattedTextbox' is not defined.
  C:\Documents and Settings\Administrator\Desktop\Gregs Projects\VBApps\SignBuilderForm\SignBuilderForm\SignBuilderForm.Designer.vb
  134    44    SignBuilderForm

Am I mistaken or is visual studio express supposed to allow you to use the designer to place your user created controls onto your project? What am I doing incorrectly here?

Thanks

P.S. I appologize for the repost, I feel that my problem is much better worded on this post. I tried to delete my previous thread but it looks like thats not an option ont his forum.
Reply With Quote