|
-
Sep 21st, 2010, 01:55 AM
#1
Adding a form from another project
To start I already removed this form and created a new one, but I'm curious why this happened and what I did wrong.
1. I created a new project and copied several forms and files from an existing project using the "Add Existing Item" function.
2. I had one form that would show but had no data.
3. I call the form like this
Code:
Private Sub mnuWaterUsers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWaterUsers.Click
Dim frm As New frmUsers
frm.Show()
End Sub
4. I put a break point at "frmUsers_load"
5 . The from would show but never hit the break point. It did go to "frmUsers_Activated"
I'm sure I'm missing something but don't know what.
-
Sep 21st, 2010, 02:09 AM
#2
Re: Adding a form from another project
A form consists of 3 or more files, not 1. If you have Form1 then its user code will be in Form1.vb file, its non-user code will be in Form1.Designer.vb file and its resources will be in Form1.resx file. You should import all three of them.
-
Sep 21st, 2010, 02:30 AM
#3
Re: Adding a form from another project
I did import all three and rebuilt the project.
thanks for the reply
-
Sep 21st, 2010, 02:35 AM
#4
Re: Adding a form from another project
Does your Load event handler actually have a Handles clause with the form's Load event in it?
-
Sep 21st, 2010, 02:51 AM
#5
Re: Adding a form from another project
jmc,
Sorry I don't know how to test what your asking since I already deleted the original form. But in the code window this is where I placed the break point.
Code:
Private Sub frmUsers_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load <- this is where I put the break point
'TODO: This line of code loads data into the 'WaterTablesDataSet.Laterals' table. You can move, or remove it, as needed.
Me.LateralsTableAdapter.Fill(Me.WaterTablesDataSet.Laterals)
'TODO: This line of code loads data into the 'WaterTablesDataSet.Crops' table. You can move, or remove it, as needed.
Me.CropsTableAdapter.Fill(Me.WaterTablesDataSet.Crops)
'TODO: This line of code loads data into the 'DsUsersDataSet.GroupLotsForUsers' table. You can move, or remove it, as needed.
Me.GroupLotsForUsersTableAdapter.Fill(Me.DsUsersDataSet.GroupLotsForUsers)
'TODO: This line of code loads data into the 'DsUsersDataSet.users' table. You can move, or remove it, as needed.
Me.UsersTableAdapter.Fill(Me.DsUsersDataSet.users)
'Load the ToolStrip LookUp ComboBox
LoadUserLookUp()
blnIsAddNew = False
strUserId = ""
Me.Show()
Me.ToolStripId.Focus()
End Sub
-
Sep 21st, 2010, 03:23 AM
#6
Re: Adding a form from another project
I should add that I deleted the "frmUsers_load" sub. Then I selected the "Load" event and inserted my code. Still did not stop at beak point.
It's not a problem, just didn't understand why this happened.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|