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

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

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!
1 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.
les51Author Commented:
thanks alot!

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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