473,473 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Visual Studio 2003 Menu on form.vb

hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in visual
basic.
The problem is i have put a menu bar onto the first form, and have created
some other forms but cannot find any options to point from the menu to any
of the other forms i have created.

can anyone help me, as i would be very greatful

Thanks Phill
Mar 14 '06 #1
7 1768
Phill Emery wrote:
hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in visual
basic.
The problem is i have put a menu bar onto the first form, and have created
some other forms but cannot find any options to point from the menu to any
of the other forms i have created.

can anyone help me, as i would be very greatful

Thanks Phill


What do you mean, "point from the menu to any other forms"

Are you asking how you open a new form from a menu item?

The menu item calls a function. In that function you can do whatever
you want, including opening a new form.

Dim NewForm as new FormType
NewForm.ShowDialog
When I create my menu I do something like (this if for a context menu)

////
RightClick.MenuItems.Add("&Edit", New EventHandler(AddressOf
EditRecord))
RightClick.MenuItems.Add("&New", New EventHandler(AddressOf
NewRecord))
RightClick.MenuItems.Add("&Delete", New EventHandler(AddressOf
DeleteRecord))
RightClick.MenuItems.Add("Re&conciled", New
EventHandler(AddressOf MarkasReconciled))
RightClick.MenuItems.Add("&Refresh", New EventHandler(AddressOf
RefreshData))
RightClick.MenuItems.Add("&Highlight", New
EventHandler(AddressOf Highlight))
\\\\

You see that I add an EventHandler that points to a function

Chris
Mar 14 '06 #2
"Phill Emery" <ph***********@hotmail.com> schrieb
hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in
visual basic.
The problem is i have put a menu bar onto the first form, and have
created some other forms but cannot find any options to point from
the menu to any of the other forms i have created.

can anyone help me, as i would be very greatful


Handle the menu's click event. In the event handler, open one of the Forms.

See also:

http://msdn.microsoft.com/library/en...ntHandling.asp

http://msdn.microsoft.com/library/en...delessForm.asp

http://msdn.microsoft.com/library/en...nheritance.asp

Armin

Mar 14 '06 #3
yes i want to know how to open a new form from a menu item.

i have got this so far

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem6.Click

Dim FilmsToGet As New Form

FilmsToGet.ShowDialog()

and want to link menu item 6 to a form called FilmsToGet.vb, but this isnt
working

and i get this error at the top of the page.

D:\My Documents\Visual Studio Projects\Film Database\Form1.vb(1): 'Class'
statement must end with a matching 'End Class'.
can you point me in the right direction please.

Phill
"Chris" <no@spam.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
Phill Emery wrote:
hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in visual
basic.
The problem is i have put a menu bar onto the first form, and have created some other forms but cannot find any options to point from the menu to any of the other forms i have created.

can anyone help me, as i would be very greatful

Thanks Phill


What do you mean, "point from the menu to any other forms"

Are you asking how you open a new form from a menu item?

The menu item calls a function. In that function you can do whatever
you want, including opening a new form.

Dim NewForm as new FormType
NewForm.ShowDialog
When I create my menu I do something like (this if for a context menu)

////
RightClick.MenuItems.Add("&Edit", New EventHandler(AddressOf
EditRecord))
RightClick.MenuItems.Add("&New", New EventHandler(AddressOf
NewRecord))
RightClick.MenuItems.Add("&Delete", New EventHandler(AddressOf
DeleteRecord))
RightClick.MenuItems.Add("Re&conciled", New
EventHandler(AddressOf MarkasReconciled))
RightClick.MenuItems.Add("&Refresh", New EventHandler(AddressOf
RefreshData))
RightClick.MenuItems.Add("&Highlight", New
EventHandler(AddressOf Highlight))
\\\\

You see that I add an EventHandler that points to a function

Chris

Mar 15 '06 #4
"Phill Emery" <ph***********@hotmail.com> schrieb
yes i want to know how to open a new form from a menu item.

i have got this so far

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem6.Click

Dim FilmsToGet As New Form

FilmsToGet.ShowDialog()

and want to link menu item 6 to a form called FilmsToGet.vb, but
this isnt working

and i get this error at the top of the page.

D:\My Documents\Visual Studio Projects\Film Database\Form1.vb(1):
'Class' statement must end with a matching 'End Class'.
can you point me in the right direction please.

Maybe you only forgot the "End Sub" to close the Sub you've shown us above?
Armin
Mar 15 '06 #5
no i have the end sub at the end, i just forgot to put that on the message
board
"Armin Zingler" <az*******@freenet.de> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
"Phill Emery" <ph***********@hotmail.com> schrieb
yes i want to know how to open a new form from a menu item.

i have got this so far

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem6.Click

Dim FilmsToGet As New Form

FilmsToGet.ShowDialog()

and want to link menu item 6 to a form called FilmsToGet.vb, but
this isnt working

and i get this error at the top of the page.

D:\My Documents\Visual Studio Projects\Film Database\Form1.vb(1):
'Class' statement must end with a matching 'End Class'.
can you point me in the right direction please.

Maybe you only forgot the "End Sub" to close the Sub you've shown us

above?

Armin

Mar 15 '06 #6
Phill Emery wrote:
yes i want to know how to open a new form from a menu item.

i have got this so far

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem6.Click

Dim FilmsToGet As New Form

FilmsToGet.ShowDialog()

and want to link menu item 6 to a form called FilmsToGet.vb, but this isnt
working

and i get this error at the top of the page.

D:\My Documents\Visual Studio Projects\Film Database\Form1.vb(1): 'Class'
statement must end with a matching 'End Class'.
can you point me in the right direction please.

Phill
"Chris" <no@spam.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
Phill Emery wrote:
hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in visual
basic.
The problem is i have put a menu bar onto the first form, and have
created
some other forms but cannot find any options to point from the menu to
any
of the other forms i have created.

can anyone help me, as i would be very greatful

Thanks Phill


What do you mean, "point from the menu to any other forms"

Are you asking how you open a new form from a menu item?

The menu item calls a function. In that function you can do whatever
you want, including opening a new form.

Dim NewForm as new FormType
NewForm.ShowDialog
When I create my menu I do something like (this if for a context menu)

////
RightClick.MenuItems.Add("&Edit", New EventHandler(AddressOf
EditRecord))
RightClick.MenuItems.Add("&New", New EventHandler(AddressOf
NewRecord))
RightClick.MenuItems.Add("&Delete", New EventHandler(AddressOf
DeleteRecord))
RightClick.MenuItems.Add("Re&conciled", New
EventHandler(AddressOf MarkasReconciled))
RightClick.MenuItems.Add("&Refresh", New EventHandler(AddressOf
RefreshData))
RightClick.MenuItems.Add("&Highlight", New
EventHandler(AddressOf Highlight))
\\\\

You see that I add an EventHandler that points to a function

Chris



your logic for opening a form is fine, you have another problem in your
code. The error message is telling you that you don't have an End Class
at the bottom for your Form1 Class. If you can't figure it out, post
the code for Form1 in here so we can look at it.

Chris
Mar 15 '06 #7
its ok now i have redone the entire thing after you said the code i did was
fine, and it works now

Thanks for the help

Phill

"Chris" <no@spam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Phill Emery wrote:
yes i want to know how to open a new form from a menu item.

i have got this so far

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem6.Click

Dim FilmsToGet As New Form

FilmsToGet.ShowDialog()

and want to link menu item 6 to a form called FilmsToGet.vb, but this isnt working

and i get this error at the top of the page.

D:\My Documents\Visual Studio Projects\Film Database\Form1.vb(1): 'Class' statement must end with a matching 'End Class'.
can you point me in the right direction please.

Phill
"Chris" <no@spam.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
Phill Emery wrote:

hi can anyone please help me?

Im new to visual studio 2003 and im trying to create a program in visualbasic.
The problem is i have put a menu bar onto the first form, and have


created
some other forms but cannot find any options to point from the menu to


any
of the other forms i have created.

can anyone help me, as i would be very greatful

Thanks Phill

What do you mean, "point from the menu to any other forms"

Are you asking how you open a new form from a menu item?

The menu item calls a function. In that function you can do whatever
you want, including opening a new form.

Dim NewForm as new FormType
NewForm.ShowDialog
When I create my menu I do something like (this if for a context menu)

////
RightClick.MenuItems.Add("&Edit", New EventHandler(AddressOf
EditRecord))
RightClick.MenuItems.Add("&New", New EventHandler(AddressOf
NewRecord))
RightClick.MenuItems.Add("&Delete", New EventHandler(AddressOf
DeleteRecord))
RightClick.MenuItems.Add("Re&conciled", New
EventHandler(AddressOf MarkasReconciled))
RightClick.MenuItems.Add("&Refresh", New EventHandler(AddressOf
RefreshData))
RightClick.MenuItems.Add("&Highlight", New
EventHandler(AddressOf Highlight))
\\\\

You see that I add an EventHandler that points to a function

Chris



your logic for opening a form is fine, you have another problem in your
code. The error message is telling you that you don't have an End Class
at the bottom for your Form1 Class. If you can't figure it out, post
the code for Form1 in here so we can look at it.

Chris

Mar 15 '06 #8

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

Similar topics

1
by: angelag | last post by:
I am currently taking a college course in Visual Basic.Net and I am a beginner. I bought Visual Studio.Net 2003 to do my homework at home. I built my first project and e-mailed it to myself at...
2
by: Matt | last post by:
I have created an MDI child form that I am using as a base form in a VB.Net MDI application. The base MDI child form has a series of menu options on it. I then use this form to create other MDI...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
1
by: Craig Skrabacz | last post by:
I originally had VB.Net standard installed on my computer. I have subsequently installed Visual Studio .Net 2002 on my computer. I have not uninstalled VB.Net. When I look in my Add/Remove...
8
by: Andrea Sansottera | last post by:
Hi fellows, I am experiencing a problem while I try to update Visual Studio.NET 2003 on Windows Server 2003. It tells me tha it is impossibile to connect to the update site. It doesn't matter...
3
by: Dave Munger | last post by:
Apologies if this is a known issue, but I couldn't seem to turn it up with google or on Technet. I am using Visual C# 2005 Express, Beta 2. I am learning C# and have come to the point in the...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
2
by: Fir5tSight | last post by:
Hi, I'm experimenting sample code created in Visual Studio 2002 (or 2003) in my Visual Studio 2005. However, I can't find the following in VS 2005: - MainMenu control in Toolbox; -...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.