943,258 Members | Top Members by Rank

Ad:
Oct 9th, 2003
1

multiform windows appliction in VB . NET

Expand Post »
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?
Reputation Points: 12
Solved Threads: 0
Light Poster
bigpoppapumpg is offline Offline
26 posts
since Oct 2003
Oct 9th, 2003
1

Re: multiform windows appliction in VB . NET

Try clicking Project > Add Form > New > Form > Open
Team Colleague
Reputation Points: 63
Solved Threads: 6
Supreme Evil Overlord
Roberdin is offline Offline
282 posts
since Feb 2003
Oct 9th, 2003
1

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:

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::
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Oct 9th, 2003
0

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?
Reputation Points: 12
Solved Threads: 0
Light Poster
bigpoppapumpg is offline Offline
26 posts
since Oct 2003
Oct 10th, 2003
0

Re: multiform windows appliction in VB . NET

When you rename the form, you also need to change the class name in the .vb file.
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: DOS "ROUTE" command
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: adding totals in listboxes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC