DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   multiform windows appliction in VB . NET (http://www.daniweb.com/forums/thread1254.html)

bigpoppapumpg Oct 9th, 2003 12:12 am
multiform windows appliction in VB . NET
 
I'm trying to build a windows app with multiple forms. in project explorer i'm right clicking the current project, add->add existing item. then I select a form, but now the project won't build. I get these errors:

'Form1' is ambiguous in the namespace 'WindowsApplication1'.

'Sub Main' was not found in 'WindowsApplication1.Form1'.

Resources 'Form1.resx' and 'MathCalculator.resx' have the same manifest resource name 'WindowsApplication1.Form1.resources'.


am I not adding forms to my project correctly?

Roberdin Oct 9th, 2003 2:15 pm
Re: multiform windows appliction in VB . NET
 
Try clicking Project > Add Form > New > Form > Open

Tekmaven Oct 9th, 2003 4:42 pm
Re: multiform windows appliction in VB . NET
 
Your problem is that the form you are adding is named "Form1" and you already have a form named "Form1".

Change the class definition for one of the forums to "Form2" or anything else you would like.

To open a form from a button on another form, this is the code:

'Assuming that the form you want to call is named Form2
Dim a as new Form2
a.Show()

I'm pretty sure the above is right.. I'm spending to much time on ASP.NET Development, and C# Windows Form development ::blushes::

bigpoppapumpg Oct 9th, 2003 9:34 pm
Re: multiform windows appliction in VB . NET
 
what is strange is I have renamed the forms in solution explorer, but when i go back to the code window it still says 'form1'. so basically if I want to call form 'a' from form 'b', I just add form 'a' to form 'b' and use the show method?

Tekmaven Oct 10th, 2003 9:11 am
Re: multiform windows appliction in VB . NET
 
When you rename the form, you also need to change the class name in the .vb file.


All times are GMT -4. The time now is 3:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC