What's the best way to handle MULTI-FORM application in VB.NET?

Posted on 2008-11-09
Last Modified: 2013-11-17
This would be a newbie's question.

The Problem:
Need to create multi-form application for the WM5 device using .NET CF 2. For example, Form A has a button that on-clicked will open FORM B, which in turn may have button to open FORM C.

I noticed we can do this:
dim theForm as new FormA()

But the problem, I found this method to make multi-form application quite slow as it seems to take a pause while trying to load the new FORM.  I also read from somewhere can use "Panel" and show-hide panel.

So my questions is really what's the BEST (as in most responsive and efficient way) to show a new selection form to the user?

2 Parts to this Question:
1. is "dim theForm as NEW FormA()" the same as "dim theForm as FormA()" without the NEW, will it cause any problem problem (they both seems to work) like speed difference?
2. pls suggest the best way to do multi-form application (with some sample codes pls).

Many Thanks experts!
Question by:les51
    LVL 83

    Accepted Solution

    The New keyword is used to create a new object of a class. Without New, this merely creates a variable but no object. This would result in Object Reference Null Exception if you try to access any properties of this form. So New must be present.
    Whether to use forms or panels is dependent on what would be present on the new forms. For example, if you need to display 20 input controls then probably form is a good choice but if its only a couple of controls then you can use panels as well.

    Author Closing Comment

    thanks alot!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now