473,394 Members | 1,766 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,394 software developers and data experts.

Where are the menu handlers?

When I double click on a menu item (design time) the form opens
in the correct place for the menu handler, but I can't find the
AddHandler statements, where do I find them so that I can
change the names of these functions?
Nov 21 '05 #1
3 965
Hi Janie,

I think this is right :-)............

The handlers are 'attached' by default and do not need to be specifically
stated. If you view the Form Designer Generated Code you will see that these
objects are declared with a WithEvents statement and that is all that is
required.

You can change the actual name of the functions to whatever you like. You
will note that the actual 'event designator' at the end of the function does
not change, ie. Button1.Click. So, you can change the names of the functions
without any further concern.

HTH,

Phil

<Janie May> wrote in message news:ei*************@TK2MSFTNGP15.phx.gbl...
When I double click on a menu item (design time) the form opens
in the correct place for the menu handler, but I can't find the
AddHandler statements, where do I find them so that I can
change the names of these functions?

Nov 21 '05 #2
Use the AddHandler statement when you want transfer the control of the event
to another precedure of same signature.

Example:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'this line transfer the event control to another procedure
AddHandler MenuItem2.Click, AddressOf MyProcedureHandler
End Sub
Private Sub MyProcedureHandler(ByVal sender As System.Object, ByVal e As
System.EventArgs)
'write your code here
'...
End Sub

[]s
Cesar
<Janie May> wrote in message news:ei*************@TK2MSFTNGP15.phx.gbl...
When I double click on a menu item (design time) the form opens
in the correct place for the menu handler, but I can't find the
AddHandler statements, where do I find them so that I can
change the names of these functions?
Nov 21 '05 #3
<Janie May> schrieb im Newsbeitrag
news:ei*************@TK2MSFTNGP15.phx.gbl...
When I double click on a menu item (design time) the form opens
in the correct place for the menu handler, but I can't find the
AddHandler statements, where do I find them so that I can
change the names of these functions?

You can change the name of the function without changing any other code.
Event and event handler are connected by the 'Handles...' clause in the
event handler's head.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

2
by: Martin Maat | last post by:
I am almost longing for MFC (no, not really, but a couple of things seem to be less powerfull in Windows.Forms). One is updating menu item status. Having commands separated from the UI thingies...
2
by: Stuart Norris | last post by:
Dear Group, I am new to c# and windows form designer - coming from a Motif background. I am attempting to develop an application for a touch screen and I need to have a menu system with a...
3
by: Marcel Hug | last post by:
Hello NG ! I would like to show the context menu which apears when i drop a file by fight mouse button. Could somebody help me ? Thanks
1
by: Dino Buljubasic | last post by:
Hi, I have a toolbar with several buttons on it, one of which is set up to be as a DropDown button. I also have a context menu with menu items assigend to it so when I click that button, my...
2
by: Peter Proost | last post by:
Hi group, I've got this ownerdraw menu module which I got from a site and modified to my personal needs, but the only problem I'm having is with the lines in a menu, when you type - as text, it...
2
by: Ludwig | last post by:
My application has a main tool strip menu (File, Options, help,...). There are also a number of context menu's that popup. Some main menu items should also be available in some context menu's. ...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
3
by: =?Utf-8?B?ZWFndWlsYXI=?= | last post by:
Hi, I am trying to dynamically generate a menu, based on entries on a text or xml file. The text file contains the "tree" after which the menu will need to be created. Something like the...
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?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.