• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

calling a form from another form

I am calling a form2 from form1, it shows it up but form2 doesn't show the controls on it like labels and textboxes.  also when I put the starposition fro form2  as centerscreen or centerparent it doesn't make any difference.

any idea?
 thanks


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim form2 As New Form
                 form2.Show()
     
    End Sub
0
jskfan
Asked:
jskfan
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You are creating an instance of a generic form in your code.  Try making an instance of Form2 instead:

    Dim f2 As New Form2
    f2.Show()

I believe CenterParent only applies to MdiChildren, but CenterScreen should work...

0
 
jskfanAuthor Commented:
correct! thanks a lot
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now