calling a form from another form

Posted on 2006-05-06
Last Modified: 2010-04-17
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?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim form2 As New Form
    End Sub
Question by:jskfan
    LVL 85

    Accepted Solution

    You are creating an instance of a generic form in your code.  Try making an instance of Form2 instead:

        Dim f2 As New Form2

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


    Author Comment

    correct! thanks a lot

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    java ^ examples 8 51
    Simple (?) problem getting Rainbow Folders to run 6 73
    EvenOdd challenge 10 69
    hasOne  challenge 59 66
    This is an explanation of a simple data model to help parse a JSON feed
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now