catch a popup context menu

  • Thread starter Thread starter E. W via DotNetMonster.com
  • Start date Start date
E

E. W via DotNetMonster.com

Hi,
I created an context menu with a popup menu (created on the fly by a
database select).
It works, but I dont know to catch the event, one of the popup items is
selected (clicked).
I only need the text of this item.
thanks
E.W.
 
Hello,
Consume each menuItem's click event when you create it using DB
results. Check if the 'sender' is a Menuitem inside the event handler ,
case it and get the text using "Text" property.

<Code in Event Handler>
if(sender is MenuItem)
{
MenuItem mi = sender as MenuItem;
if(mi != null)
string text = mi.Text;
}

HTH. Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
 
Hello,
Consume each menuItem's click event when you create it using DB
results. Check if the 'sender' is a Menuitem inside the event handler ,
case it and get the text using "Text" property.

<Code in Event Handler>
if(sender is MenuItem)
{
MenuItem mi = sender as MenuItem;
if(mi != null)
string text = mi.Text;
}

HTH. Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top