geo1st487 Posted May 10, 2003 Posted May 10, 2003 How to show a form in VB.NET? I should use e.g. form1.show ? Thanks :) Quote
hog Posted May 10, 2003 Posted May 10, 2003 Dim frmForm As New frmWhatEver() frmForm.Show() Quote My website
geo1st487 Posted May 10, 2003 Author Posted May 10, 2003 If the name of the form is form1 then can i use form1.show() for show form? Thanks :) Quote
wyrd Posted May 10, 2003 Posted May 10, 2003 Use the example hog gave you. Forms in .NET are classes, so you must use them as such. To use a class you must first instantiate it (you know, with the new keyword). Dim frm As New form1() frm.Show() Quote Gamer extraordinaire. Programmer wannabe.
geo1st487 Posted May 10, 2003 Author Posted May 10, 2003 After the following code required to write set frm = Nothing for release the memory? Thanks :) Dim frm As New form1() frm.Show() Quote
Guest mutant Posted May 10, 2003 Posted May 10, 2003 To release memory taken by it type: formname.Dispose() Quote
*Experts* Nerseus Posted May 12, 2003 *Experts* Posted May 12, 2003 You only need to call Dispose if you showed the form using ShowDialog. If you just used form.Show(), you don't have to call Dispose(). -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
archer_coal Posted June 9, 2003 Posted June 9, 2003 Notify Icon anyone run into a problem with a tray icon loading several times using the above method? Dim frmMain as new FormMain() frmMain.show() If you have a tray icon (Notify Icon) loading with your Main form and switch from a second form back to the form using the Notify Icon, it loads another icon into the tray each time. Quote
iebidan Posted June 9, 2003 Posted June 9, 2003 Nerseus, how's that, that you don't need to call the dispose method when you use the show, only when you use the ShowDialog method??? This means that in my app I've beed doing things wrong????, why in every place around the internet they say that if you want to unload, close the form you need to call the dispose method the gice the GC chance to clean up the memory??? Quote Fat kids are harder to kidnap
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.