Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

inherited control not recognized in c# csharp .net

Avatar of yaronusa
yaronusa asked on
.NET ProgrammingC#
5 Comments1 Solution636 ViewsLast Modified:
I created an inherited TreeView control I call WaferTreeView. After creating it, I see it available in my toolbox. I then drag it onto my main form, and it is autmatically called WaferTreeView1.

Once I look at any other file in my project, I cannot view my main form in design view, because of this listed error: "The variable 'waferTreeView1' is either undeclared or was never assigned."

I only dragged and dropped the inherited WaferTreeView onto the form, and like any other control, I expect the designer to have the code it needs to make it work.

Upon examining the designer code of the form containing the WaferTreeView control, I noticed that the WaferTreeView type is unknown (in black instead of light blue color).

Why is this?? What should I do? Please help.
// Can't view main form because of this error:
// The variable 'waferTreeView1' is either undeclared or was never assigned.
 
 
// As you can see below, 'waferTreeView1' IS declared and assigned:
namespace MainForm
{
  partial class frmGridTester
  {
    ...
    private void InitializeComponent()
    {
      ...
      this.waferTreeView1 = new WaferTree.WaferTreeView();
      this.table.Controls.Add(this.waferTreeView1, 0, 1);
      ...
    }
    
 
    // WaferTreeView is an unknown type (therefore shown in
    // black color instead of light blue). WHY??
    private WaferTreeView waferTreeView1;
    
  }
}
 
 
namespace WaferTree
{
  public partial class WaferTreeView : TreeView
  {
 
    public WaferTreeView(): base()
    {
      InitializeComponent();
    }
  
    ...
  }
 
  public class WaferTreeNode : TreeNode
  {
    ...
  }
}
ASKER CERTIFIED SOLUTION
Avatar of pvginkel
pvginkelFlag of Netherlands image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers