Groups | Blog | Home
all groups > vb.net upgrade > february 2006 >

vb.net upgrade : Forms migration


bulldog8 NO[at]SPAM lycos.com
2/23/2006 3:35:57 PM
I recently took the plunge and upgraded to VB .Net an am a bit stumped
with some results.

I started with a simple project that has 2 forms: Load and Manage

The Load form was identified as the start point under VB6 and contained
a button that launched the Manage form ... here are the issues that
I've encountered

1) The command button on the Load form that launches the Manage form
now shuts down the app unless I keep the Load form open:

Old:
Private Sub cmdManage_Click()
Unload frmMain
frmManage.Show
End Sub

New:
Private Sub cmdManage_Click(yada yada yada) Handles cmdManage.Click
frmMain.DefInstance.Close()
frmManage.DefInstance.Show()
End Sub


If I comment out the "frmMain.DefInstance.Close()" line, the Manage
form opens fine. But now I have 2 forms open, and that forces the user
to close both when before there was only 1 form open at a time. (There
is no button on the Manage form that allows the user to go back to the
Load form ...)


2) All the objects on the Load form keep being reset to the top left
corner....


I picked a simple project as a first and thought it would be easy .. I
am dreading the larger projects already!!!!!

Any comments / suggestions are welcome. I'm looking for a good book if
there are any suggestions on that point also ...

Thanks!
Jon
Homer J Simpson
2/24/2006 12:27:51 AM

[quoted text, click to view]

See 'Anchor' and 'Dock'

[quoted text, click to view]

I suspect it's the 'object' stuff - you have to create the Manage form and
then show it perhaps? And if you close the Main form it closes its children?

If you look in "101 VB.NET Samples\Windows Forms - How-To Top-Level Forms"

you will find an example of opening forms which you can close in any order.

AddThis Social Bookmark Button