all groups > vb.net upgrade > march 2006 >
You're in the

vb.net upgrade

group:

Change main form


Change main form Dave Harry
3/9/2006 12:00:00 AM
vb.net upgrade:
Hi Folks

Brand new to VB .NET 2003 after a little playing with VB6 and now I'm trying
to convert my programs. I'm having trouble switching forms.

In VB6, I loaded the first form, which did some checks during its load, then
all being well it switched to a new form (without appearing), which during
the second form's load process, unloaded the first form. If the checks did
not balance, the first form was displayed.

When I try to do this in .NET, I have either both forms close, or the first
one stays open.

What's the best process for this in .NET. Code examples would be awesome.
TIA

--
Dave Harry

Re: Change main form gene kelley
3/12/2006 4:23:23 PM
On Thu, 9 Mar 2006 11:10:38 +1100, "Dave Harry"
[quoted text, click to view]

You might want to rethink your startup logic.
In the original VB6 app, you should have created a Sub Main () in a
module and used that as you startup object. In Sub Main (), you would
do your "checks" and, depending on the results, show the appropriate
form. This same logic should work in VB2003.

Gene
Re: Change main form Dave Harry
3/14/2006 12:00:00 AM
Thanks guys, that's helpful.

Mark, I couldn't actually *open* your 2005 project in my 2003, but I still
managed to glean some useful info.

--
Dave Harry

AddThis Social Bookmark Button