473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form from a Main Menu

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

Nov 20 '05 #1
8 1309
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" <el**********@yahoo.com> wrote in message
news:F3**********************************@microsof t.com...
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
EndItem.ShowDialog()
Cursor = System.Windows.Forms.Cursors.Default
End Sub

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,
Elena

Nov 20 '05 #2
[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]
Nov 20 '05 #3
Didn't work. What else could I try?
Nov 20 '05 #4
should work...

send some code...
"Elena" <el**********@yahoo.com> wrote in message
news:F3**********************************@microsof t.com...
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
EndItem.ShowDialog()
Cursor = System.Windows.Forms.Cursors.Default
End Sub

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,
Elena

Nov 20 '05 #5
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.
Nov 20 '05 #6
* "=?Utf-8?B?RWxlbmE=?=" <el**********@yahoo.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
On Wed, 4 Feb 2004 12:46:07 -0800, Elena wrote:

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.
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #8
This worked, thank you.
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
7
by: Danielb | last post by:
I want my application to run most of the time as just an notify icon visible in the system tray, with some dialogs windows that open if the user selects an option from the context menu on the tray...
3
by: Marius Rus | last post by:
I have an application write in c# and i want to offer to the user to create himself shortcuts with icons for the main menu items. I will very much appreciate if will receive an helping hand. Thank...
8
by: Daves | last post by:
in the old ASP I used FORMs only when relevant. In the .Net architecture they seem to be unmissable because of the Postback functions eg <a OnServerClick="_GoHere" runat="server">Click me</a> Ok...
6
by: Shane Saunders | last post by:
I have a menu option that loads a form and displays infomation. if you go to main form and try to load something else from that same menu, it does a check to see if the form in exist and then...
0
by: Amiram Korach | last post by:
When you create a MDI form, you can attach a main menu to the parent and to the child. When a child form is active, its menu is merged with the parent menu. The problem is: when the forms are...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
2
by: Matt | last post by:
Ok here is my problem: I have a MDI parent form called "Main" that I declare in a public module when I start up my program. This form holds the drop down menu that allows my users to access all...
0
by: JRough | last post by:
Hi, I have a page with a form that is included into a php page. It has some php variables which are headers based on the user choices. In the form I will send some mysql data columns but right...
1
by: CAM | last post by:
Hello, I have a form called "Unassigned" that has a control button called "Main Menu" when pushed the button opens the "main menu" form, but I want to close the the "Unassigned" form after I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.