Trying to reference one of my forms and it isn't listed - Help??

  • Thread starter Thread starter Siv
  • Start date Start date
S

Siv

Hi,

I have a form in my project called "Uploader" and I want to access it from a
menu within the main form using the following:

Uploader frm = new Uploader();
frm.ShowDialog();

Where normally when I type the word "Uploader" the intellisense lists the
form name ready for autocomplete I don't get it listed and if I manually
enter the code and compile, I get the following error:

Error 9 The type or namespace name 'Uploader' could not be found (are you
missing a using directive or an assembly reference?)

This is strange, I can do this with all my other forms and it works fine,
anyone know why this one just doesn't appear??

Siv
Martley, Near Worcester UK.
 
Siv said:
Hi,

I have a form in my project called "Uploader" and I want to access it from a
menu within the main form using the following:

Uploader frm = new Uploader();
frm.ShowDialog();

Where normally when I type the word "Uploader" the intellisense lists the
form name ready for autocomplete I don't get it listed and if I manually
enter the code and compile, I get the following error:

Error 9 The type or namespace name 'Uploader' could not be found (are you
missing a using directive or an assembly reference?)

This is strange, I can do this with all my other forms and it works fine,
anyone know why this one just doesn't appear??

Check to see if your Uploader form is in the same namespace as your
other forms. Do you have a namespace statement at the top of the
Uploader form? Is it the same as your other forms? Is the Uploader
form in the same project or a different project? If it is in a
different project, does that project have the same namespace as the
other forms?
 
This is strange, I can do this with all my other forms and it works fine,
anyone know why this one just doesn't appear??

Is the form public?

Is it in a separate namespace?
 
Chris,
Thanks, I have been looking all over the place for the reason and it is
staring right at me. I had rebuilt this project after an issue with a
corrupted resource file. The original program was named Tacsy so the
namespace was created as Tacsy as well. When I recreated the solution and
imported the files I had used TACSY, so all my other forms that did work
contained Tascy (including the main form that was trying to show the new
one) as the namespace and my new one had TACSY. Arrrrgggghhhhh!!!!

At least I will be able to sleep tonight now I know why the bl**dy thing was
complaining.

I develop in both C# and VB and came from a VB background and this case
sensitivity thing keeps catching me out.

Thanks again.

Siv
 
Peter,
Thanks, it was the namespace. I have been looking all over the place for the
reason and it is staring right at me. I had rebuilt this project after an
issue with a corrupted resource file. The original program was named
"Tacsy" so the namespace was created as "Tacsy" as well. When I recreated
the solution and imported the files I had used "TACSY", so all my other
forms that did work contained "Tacsy" (including the main form that was
trying to show the new one) as the namespace and my new one had "TACSY".
Arrrrgggghhhhh!!!!

At least I will be able to sleep tonight now I know why the bl**dy thing was
complaining.

I develop in both C# and VB and came from a VB background and this case
sensitivity thing keeps catching me out.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top