Solved

This may seam like a dum question: im trying to learn vb.net and i dont know how to do menus it used to be select case index,case 1 etc

Posted on 2004-09-25
6
154 Views
Last Modified: 2010-04-23
im trying to learn vb.net and cant seam to understand how a menu works


it used to be select index
case 1' text
'do work for textselected menu option
case 2 'excel
'do work for excel selected menu option
end select

i dont understand how to do it now..(man its hard for a basic coder to understand all this jumbo)it like learning chinnese(no offence)

dang really confuzzled
Johnny
aka Pern
0
Comment
Question by:Johnny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 300 total points
ID: 12153226
Add menu and write your code under menu click event

    Private Sub Mymenu_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Mymenu.Click

        TextBox1.Text = "Menu is clicked"

    End Sub
0
 

Author Comment

by:Johnny
ID: 12153242
what about multi tiered menus like


tools
.. inport
.. export
....text
....excel

i dont understand how to get the area for text and excel as its a submenu of export and tools

??????
thx
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12153254
Add menu to the form and you will see how to do menu and submenu
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 5

Assisted Solution

by:tzxie2000
tzxie2000 earned 50 total points
ID: 12153938
put a mainmenu or contextmenu on the form
add menuitem to it
double-click the item and then you can write code like

 Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
......
    End Sub

VB.Net set each menuitem as an component(object) and the mainmenu as container
so we can write event for menuitem
the full action is doing by event process know as button click event
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 150 total points
ID: 12155008
Each menuitem has its own Click event (unless you handle them all with the same method). You can add code to each menu item click event.
0
 

Author Comment

by:Johnny
ID: 12155134
emoreau explaned it best,

tzxie2000 gave insight

and iboutchkine i didnt understand till others piped in but had answered the question

thanks i didnt make a menu past one item so i never saw the way it made them.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question