473,386 Members | 1,706 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.

Get the control that fired the context menu

I have a scenario where a user can click on a textbox, a context menu is
displayed and he can select a particular text from the list. Then, that text
will be appended to the textbox.

Thus i have several textboxes, that share the same context menu since the
text is common, and all the items in the context menu share the same click
event since they perform the same action, its just the text to append that
varies.

My query is from that event, how would i find out which textbox was used?
Apr 26 '07 #1
1 6791
"Robert Mago" <ro****@mago.comwrote in message
news:uy**************@TK2MSFTNGP02.phx.gbl...
>I have a scenario where a user can click on a textbox, a context menu is
displayed and he can select a particular text from the list. Then, that
text will be appended to the textbox.

Thus i have several textboxes, that share the same context menu since the
text is common, and all the items in the context menu share the same click
event since they perform the same action, its just the text to append that
varies.

My query is from that event, how would i find out which textbox was used?

In the event, the "sender" argument will give you the ContextMenu that
triggered the event. Now that you have the contextmenu, its property
"SourceControl" will give you the control that is displaying the
contextmenu.

Apr 26 '07 #2

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

Similar topics

4
by: Mark Parter | last post by:
I have a master page which contains a Menu control and a SiteMapPath control, both are bound to the same web.sitemap XML file. Say I have 2 pages, Page 1 and Page 2. Now Page 2 can only be accessed...
1
by: Chris Murphy via DotNetMonster.com | last post by:
Hi all, I'm just wondering if any one can help me with this development issue I'm having. I've created a customized treeview control to handle the particular tasks to which I'll be using it. Within...
1
by: genojoe | last post by:
I have a VB.NET application with two forms that contain a RichTextBox. I have created a context menu for one of the RTF controls. I want the same context menu to work for both. The no-brainer...
2
by: Lucky | last post by:
hi guys, i'm working on the context menu for the controls. the problem i'm facing right now is like this : i want to use one context menu for more then one controls lets say i want to use one...
10
by: AG | last post by:
Using the new ASP.NET 2.0 menu control on a master page. Is there any way to NOT have the current page be a live link and ideally also have it appear in a different style? Similar to the...
1
by: John Google | last post by:
Hi, I'm using VS2005 .NET 2.0. I want to have a single context menu on a form and link it to various controls via the ContextMenuStrip property of each control. Then I want to dynamically...
0
by: Newbie Coder | last post by:
I have added a context menu to a user control with just copy/paste on it. This is set for all areas of my user control, but when compiled, added to a Windows form the context menu doesn't show....
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
5
WebDunce
by: WebDunce | last post by:
hey all, i'm building a custom control. it contains a treeview and a context menu. each tree node's context menu property is set to the control's context menu. it works good...except... if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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,...
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
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...

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.