multiform windows appliction in VB . NET

Reply

Join Date: Oct 2003
Posts: 26
Reputation: bigpoppapumpg is an unknown quantity at this point 
Solved Threads: 0
bigpoppapumpg bigpoppapumpg is offline Offline
Light Poster

multiform windows appliction in VB . NET

 
1
  #1
Oct 9th, 2003
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?
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: multiform windows appliction in VB . NET

 
1
  #2
Oct 9th, 2003
Try clicking Project > Add Form > New > Form > Open
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 28
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: multiform windows appliction in VB . NET

 
1
  #3
Oct 9th, 2003
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:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. 'Assuming that the form you want to call is named Form2
  2. Dim a as new Form2
  3. 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::
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Oct 2003
Posts: 26
Reputation: bigpoppapumpg is an unknown quantity at this point 
Solved Threads: 0
bigpoppapumpg bigpoppapumpg is offline Offline
Light Poster

Re: multiform windows appliction in VB . NET

 
0
  #4
Oct 9th, 2003
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?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 28
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: multiform windows appliction in VB . NET

 
0
  #5
Oct 10th, 2003
When you rename the form, you also need to change the class name in the .vb file.
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC