| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Multiple Forms in VisualBasic.net | |
|---|---|
| Tweet Topic Started: Mar 11 2005, 06:27 AM (212 Views) | |
| tessa | Mar 11 2005, 06:27 AM Post #1 |
|
Member
![]() ![]() ![]()
|
Hi, I'm trying to create multiple forms the same project in visual basic.net and having a ton of trouble! I created another form by going to File, Add New Item, then clicking on Windows Form and naming it InventoryJournal.vb (my main form is named InventoryForm I've created a Public Class listing of the forms to be used: Public Class MyFormClassLibrary Public Shared frmInventoryForm As Form Public Shared frmInventoryJournal As Form End Class And then, in each form, I created a Form Load Event by typing in the code (changing it for each form, of course): Private Sub frmInventoryJournal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MyFormClassLibrary.frmInventoryJournal = Me End Sub I then created command buttons in order to easily toggle between the 2 forms, but it doesn't seem to be working... On one form, the button's code is: Private Sub cmdInventoryJournal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdInventoryJournal.Click Dim frmInventoryJournal As New frmInventory Journal frmTranscript.Show() End Sub On the other form, the button's code is: Private Sub cmdInventoryForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdInventoryForm.Click myFormClassLibrary.frmInventoryJournal.Close() myFormClassLibrary.frmInventoryForm.Show() End Sub I don't know what i'm doing wrong, but the main error message I keep getting is, "Unable to open module file 'C:\Documents and Settings\Tess\MyDocuments\Visual Studio Projects\ProgrammingAssignment\InventoryJournal.vb'" I manually opened that folder, looking for InventoryJournal.vb to make sure it was in the folder, and it WAS, so i'm not sure what this error means, or whether i'm doing the whole procedure right. Please help! Any knowledge would be appreciated! |
![]() |
|
| RagingFuryBlack-ZNS | Mar 17 2005, 04:04 PM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]()
|
Attempt to rebulld your file, and email me your source if that doesnt work and ill take a looksie at it. Email:RagingFury(nospam)Black@forumstyles.net Hints: Remove the (nospam) from my addy
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
2:37 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)



2:37 PM Jul 11