Nitriq is a product by
Home
|
Console Edition
|
Features
|
Getting Started
|
Documentation
|
Support
|
Blog
|
About
Accessing The Control Responsible For A ContextMenuStrip
It certainly isn't easy to access what winform control was ultimately responsible for bringing up a ContextMenuStrip, but it is indeed possible, there is just some casting involved :)
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (((ContextMenuStrip)((ToolStripMenuItem)sender).Owner).SourceControl ==
this.PrimeNumbersCheckBoxList)
{
this.SelectAllThePrimeNumbers();
}
if (((ContextMenuStrip)((ToolStripMenuItem)sender).Owner).SourceControl ==
this.CompositeNumbersCheckBoxList)
{
this.SelectAllTheCompositeNumbers();
}
}
Thursday, December 27, 2007 - 5:06 PM CST -
Permalink
-
Comments [0]
Tags:
Tips and Tricks
Comments are closed.
Click
Download Nitriq Now
for download options on the
NimblePros download page.
RSS
Tags
Atomiq
Blend
CopyPasteKiller
Design
Flamebait
Hacker News
IADNUG
Nitriq
Projects
Stuff
Tips and Tricks
Wishlist
XAML
Archive
September, 2010 (1)
July, 2010 (2)
June, 2010 (2)
May, 2010 (1)
April, 2010 (1)
March, 2010 (1)
November, 2009 (1)
October, 2009 (5)
September, 2009 (1)
August, 2009 (1)
July, 2009 (1)
June, 2009 (1)
May, 2009 (1)
April, 2009 (2)
March, 2009 (1)
February, 2009 (2)
January, 2009 (1)
October, 2008 (1)
September, 2008 (1)
August, 2008 (1)
July, 2008 (2)
June, 2008 (2)
May, 2008 (2)
March, 2008 (2)
February, 2008 (8)
January, 2008 (4)
December, 2007 (6)
November, 2007 (2)