New Form not recognized in intellisense

sputnik

Member
Joined
Oct 11, 2005
Messages
10
Programming Experience
5-10
I did some work on a form outside a project of mine - once it was finished, I added the new forms into my existing project
I'm trying to open the new form:
Dim edit as new frmEdit

However, even though the form is there in the project, VS2008 underlines 'frmEdit' and says it's not defined.

I've cleaned and rebuilt the project, but the same thing happens. (I've also tried renaming it several times)

Any ideas on how to fix this?
 
VB forms actually have two names and often they are not the same (in fact, I've never, ever, had a form that had the same thing for both names)

One is the disk file name. For instance, your could save your file to disk as frmEdit.Vb, but still have it retain an internal form name of Form1.

What does it say in the Name property of its property page?
 
I did some work on a form outside a project of mine - once it was finished, I added the new forms into my existing project
I'm trying to open the new form:
Dim edit as new frmEdit

However, even though the form is there in the project, VS2008 underlines 'frmEdit' and says it's not defined.

I've cleaned and rebuilt the project, but the same thing happens. (I've also tried renaming it several times)

Any ideas on how to fix this?


Probably the forms you imported are in a different namespace.

Look at the code at the top:

VB.NET:
Imports blahblah

Namespace [B]OtherProject[/B]

   Class Form1 Inherits Form


in your current projecT:

VB.NET:
Imports blahblah

Namespace [B]NewProject[/B]

   Class Form1 Inherits Form

     Public Sub New()
       Dim f1 as New OtherProject.Form1
     End Sub


In C# I just point to the wiggly line and it offers to change the namespace or do an Imports for me.. Are you sure you don't have that in VB? Maybe click the "help with this error" suggestion
 
Be sure to add the project or library the form resides in (the assembly) to the references of your project if it is not in the same project as the rest of your code.
 
Back
Top