Connecting Tech Pros Worldwide Help | Site Map

Simple GUI with VB .NET - Help, this is an easy one...

Newbie
 
Join Date: Mar 2007
Posts: 9
#1: Jun 26 '07
Well, I hope it's easy. I'm making a GUI for user-centered design (the actual GUI is NOT the project, but it helps make it look good IE, this isn't for a grade). I've never used VB before, but I'm giving it a shot. Anyway, I'm running Visual Studio 2005 and all I need to know is:

How do you use buttons to make a transition from one form to another?

Here's the code, mine's in italics:

Private Sub registerNowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles registerNowButton.Click

mainPage.ActiveForm().Hide()
registerNow.ActiveForm().Show()


End Sub


When I run the debugger, I click the button, the mainPage form goes away, but the registerNow form doesn't appear.

Then I get a null-pointer error at:
registerNow.ActiveForm().Show()

So, the registerNow form isn't initialized? That's my guess, but if knew what I was doing, I wouldn't have posted this.

Any help will be appreciated, thanks.
Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#2: Jun 26 '07

re: Simple GUI with VB .NET - Help, this is an easy one...


I use VB6, which is totally different in this area. But perhaps you need to Load the form first?
Reply