Hi

> Anybody can give me a example about popup a menu by using
> contextmenu. 

This really should be on the mono-devel list...

protected void contextMenu1_Popup(System.Object sender, System.EventArgs
e)
{
// Clear the contents of the context menu.
   contextMenu1.MenuItems.Clear();

// Add a menu item for the Checked state.
   contextMenu1.MenuItems.Add("Checked",new 
System.EventHandler(this.Checked_OnClick));
// Add a menu item for the Unchecked state.
   contextMenu1.MenuItems.Add("Unchecked",new 
System.EventHandler(this.Unchecked_OnClick));

// Test which control it is.
// If it is the CheckBox, add a menu item for the Indeterminate state.
   if (contextMenu1.SourceControl == checkBox1)
   {
     this.contextMenu1.MenuItems.Add("Indeterminate", new 
System.EventHandler(this.Indeterminate_OnClick));
   }
}

TTFN

Paul
-- 
"He's not the Messiah, he's a very naughty boy!"
- Life of Brian, Monty Python

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to