By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,166 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,166 IT Pros & Developers. It's quick & easy.

showing a form

P: n/a
Hi,

I am learning vb.net and am trying to move between forms in a windows
application that I am writing. The following code is what I am using to
call up a form called 'Scores' from the start-up form called names. Scores
has a label and a text box and two buttons that move either back to the
first form or move to the third form. When I run this, it brings up a blank
form (ie without any buttons or boxes).

Could someone please let me know what I may be doing wrong. Does the ' dim
scores as new form' create a blank form? Can I just use 'dim scores as
form' instead?

Private Sub Button3_Click(ByVal sender As System.Object, byVal e As
System.EventArgs) Handles Button3.Click

Dim Scores As New Form

Scores.Show()

Me.Hide()

End Sub

thanks for your kind assistance

Doug


Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Your problem is with the line:
Dim Scores As New Form
This is declaring "Scores" as being a new blank form.

Try this:
Dim Scores As New Scores
Where the last "Scores" is the object type of the form you want to display.

Jody
"gordon" <go**********@optusnet.com.au> wrote in message
news:42**********************@news.optusnet.com.au ...
Hi,

I am learning vb.net and am trying to move between forms in a windows
application that I am writing. The following code is what I am using to
call up a form called 'Scores' from the start-up form called names.
Scores has a label and a text box and two buttons that move either back to
the first form or move to the third form. When I run this, it brings up a
blank form (ie without any buttons or boxes).

Could someone please let me know what I may be doing wrong. Does the '
dim scores as new form' create a blank form? Can I just use 'dim scores
as form' instead?

Private Sub Button3_Click(ByVal sender As System.Object, byVal e As
System.EventArgs) Handles Button3.Click

Dim Scores As New Form

Scores.Show()

Me.Hide()

End Sub

thanks for your kind assistance

Doug

Nov 21 '05 #2

P: n/a
Thank you Jody for your advice - it works as anticipated now.

Doug
"Jody Gelowitz" <jg**************@blah.leevalley.com> wrote in message
news:ev**************@TK2MSFTNGP15.phx.gbl...
Your problem is with the line:
Dim Scores As New Form
This is declaring "Scores" as being a new blank form.

Try this:
Dim Scores As New Scores
Where the last "Scores" is the object type of the form you want to
display.

Jody
"gordon" <go**********@optusnet.com.au> wrote in message
news:42**********************@news.optusnet.com.au ...
Hi,

I am learning vb.net and am trying to move between forms in a windows
application that I am writing. The following code is what I am using to
call up a form called 'Scores' from the start-up form called names.
Scores has a label and a text box and two buttons that move either back
to the first form or move to the third form. When I run this, it brings
up a blank form (ie without any buttons or boxes).

Could someone please let me know what I may be doing wrong. Does the '
dim scores as new form' create a blank form? Can I just use 'dim scores
as form' instead?

Private Sub Button3_Click(ByVal sender As System.Object, byVal e As
System.EventArgs) Handles Button3.Click

Dim Scores As New Form

Scores.Show()

Me.Hide()

End Sub

thanks for your kind assistance

Doug


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.