|
-
Jul 4th, 2003, 03:18 PM
#1
Thread Starter
New Member
forms and vb.net
trying to close one form and display another froma command button but i keep getting this error.
An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication1.exe
Additional information: Object reference not set to an instance of an object.
i've tried .show .showdialog and nothing seems to work. first program i've tried to do in .net so there could be something that's changed from 6.0 that i'm missing
if it helps at here here's the code where i get the error trying to show the form
Private Sub CmdEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdEnter.Click
Pass = TxtPassword.Text
If Pass <> passcheck Then
MsgBox("Wrong password enterd", MsgBoxStyle.OKOnly)
Else
Me.Hide()
form2.Show()
End If
End Sub
-
Jul 4th, 2003, 04:05 PM
#2
PowerPoster
Short answer:
Dim frm as New Form2
frm.Show()
Best answer, and a requirement to understanding the why and hows of multiple forms in .Net:
http://msdn.microsoft.com/library/de...adingtonet.asp
It is required reading for upgrading from VB6 to VB.Net
-
Jul 4th, 2003, 04:33 PM
#3
Thread Starter
New Member
thank you very much
never found that when searching the web
and msdn i've found often times isn't much of a help
been stuck on this for couple days now thanks for the info and the link to read up
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|