Results 1 to 6 of 6

Thread: Adding a form from another project

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    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.

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    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.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    Re: Adding a form from another project

    I did import all three and rebuilt the project.

    thanks for the reply

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    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

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    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
  •  



Click Here to Expand Forum to Full Width