Form from a Main Menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a main menu. From that menu, I want to select another form. I have the code behind it, yet when the form appears it's blank. It is not the one I've created

This is the code
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Clic
Cursor = System.Windows.Forms.Cursors.WaitCurso
Dim EndItem As New For
EndItem.ShowDialog(
Cursor = System.Windows.Forms.Cursors.Defaul
End Su

End Item is the name of the form I want to display

I have no idea what it wrong. I wrote this code for another program and it works fine there

Thanks in advance
Elen
 
well enditem will be a Form object, which is the base form
that form is empty...

if for example you created a new form named Form2 you have to do:

Dim EndItem as New Form2()
that will create an instance of Form2 and not an instance of Form...


hope this helps

Dominique


Elena said:
I have a form with a main menu. From that menu, I want to select another
form. I have the code behind it, yet when the form appears it's blank. It
is not the one I've created.
This is the code:
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
 
[snip]
..
This is the code:
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click Cursor =
System.Windows.Forms.Cursors.WaitCursor
Dim EndItem As New Form

Use:
Dim EndItem As New YourDerivedForm
The Form class is blank.
EndItem.ShowDialog()
Cursor = System.Windows.Forms.Cursors.Default
End Sub
[snip]
 
should work...

send some code...


Elena said:
I have a form with a main menu. From that menu, I want to select another
form. I have the code behind it, yet when the form appears it's blank. It
is not the one I've created.
This is the code:
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
 
When I put :

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
Cursor = System.Windows.Forms.Cursors.WaitCursor
Dim EndItem As New Form2
EndItem.ShowDialog()
Cursor = System.Windows.Forms.Cursors.Default
End Sub

I get an error: Type 'Form2' is not defined.
 
I get an error: Type 'Form2' is not defined.

What is the name of your form class? In the form's .vb file, what is the
name of the Public Class? Show us the first few lines of your form's
class.
 
* "=?Utf-8?B?RWxlbmE=?= said:
I have a form with a main menu. From that menu, I want to select
another form. I have the code behind it, yet when the form appears it's
blank. It is not the one I've created.

This is the code:
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
Cursor = System.Windows.Forms.Cursors.WaitCursor
Dim EndItem As New Form

Replace the 'Form' in the line above with the class name of your form.
 
Back
Top