GOA - System.Windows.Forms.ContextMenuStrip

ContextMenuStrip Class


Represents a shortcut menu.

Definition

public class ContextMenuStrip: ToolStripDropDownMenu

Members Table

MethodDescription
AdjustFormScrollbarsAdjusts the scroll bars on the container they are applied on. (Inherited from ScrollableControl)
BringToFrontBrings the control to the front of the z-order. (Inherited from Control)
CloseOverloaded. Closes the ToolStripDropDown control. (Inherited from ToolStripDropDown)
ContainsReturns a value indicating whether the specified control is a child of the control. (Inherited from Control)
ContextMenuStripInitializes a new instance of ContextMenuStrip.
CreateControlForces the creation of the control, including the creation of the handle and any child controls. (Inherited from Control)
CreateControlSkinCreates the skin for the Control. (Inherited from Control)
CreateControlSkinInstanceOverriden. Creates a ControlSkin instance for the Control. (Inherited from ToolStrip)
CreateControlsInstanceCreates a new instance of the control collection for the control. (Inherited from Control)
CreateDefaultItemCreates a default ToolStripItem on a new ToolStrip instance. (Inherited from ToolStrip)
CreateHandleCreates a handle for the control. (Inherited from Control)
DestroyHandleDestroys the handle associated with the control. (Inherited from Control)
DisposeOverloaded. (Inherited from Component)
EqualsOverloaded. Compares two objects to determine if they are equal. (Inherited from Object)
FindFormReturns the form that the control is on. (Inherited from Control)
FocusSets input focus to the control. (Inherited from Control)
GetChildAtPointReturns the child control that is located at the specified coordinates. (Inherited from Control)
GetContainerControlReturns the next ContainerControl up the control's chain of parent controls. (Inherited from Control)
GetHashCodeServes as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object)
GetItemAtOverloaded. Returns the item that is located at the specifed location on the ToolStrip. (Inherited from ToolStrip)
GetNextControlReturns the next control forward or back in the tab order of child controls. (Inherited from Control)
GetNextItemReturns the next ToolStripItem that bases on the specified reference item and moving in the specified direction. (Inherited from ToolStrip)
GetScrollStateDetermines whether the specified flag has been set. (Inherited from ScrollableControl)
GetStyleReturns the value of the specified control style bit for the control. (Inherited from Control)
GetTopLevelDetermines if the control is a top-level control. (Inherited from Control)
GetTypeGets the Type of the current instance. (Inherited from Object)
HideHides the control from the user. (Inherited from Control)
InitLayoutInitializes the layout state of the control after it has been added to another container. (Inherited from Control)
InternalMethodInherited from Control.
InvalidateOverloaded. Invalidates the control. This will cause a paint event to be sent later to the control. (Inherited from Control)
InvokeGotFocusRaises the GotFocus event for the specified control. (Inherited from Control)
InvokeLostFocusRaises the LostFocus event for the specified control. (Inherited from Control)
InvokeOnClickRaises the Click event for the specified control. (Inherited from Control)
InvokePaintRaises the Paint event for the specified control. (Inherited from Control)
InvokePaintBackgroundInvoke the Control.OnPaintBackground method for the specified control. (Inherited from Control)
IsInputCharOverriden. Determines if a character is an input character that the control recognizes. (Inherited from ToolStrip)
IsInputKeyOverriden. Determines whether the specified key is a regular input key or a special key that requires preprocessing. (Inherited from ToolStrip)
IsMnemonicDetermines if the specified character is the mnemonic character assigned to the control in the specified string. (Inherited from Control)
OnBackColorChangedRaises the BackColorChanged event. (Inherited from Control)
OnBeginDragRaises the BeginDrag event. (Inherited from ToolStrip)
OnCausesValidationChangedRaises the CausesValidationChanged event. (Inherited from Control)
OnClickRaises the Click event. (Inherited from Control)
OnClientSizeChangedInherited from Control.
OnClosedRaises the Closed event. (Inherited from ToolStripDropDown)
OnClosingRaises the Closing event. (Inherited from ToolStripDropDown)
OnControlAddedRaises the ControlAdded event. (Inherited from Control)
OnControlRemovedRaises the ControlRemoved event. (Inherited from Control)
OnCreateControlOverriden. Raises the CreateControl event. (Inherited from ToolStrip)
OnCursorChangedRaises the CursorChanged event. (Inherited from Control)
OnDockChangedRaises the DockChanged event. (Inherited from Control)
OnDoubleClickRaises the DoubleClick event. (Inherited from Control)
OnEnabledChangedRaises the EnabledChanged event. (Inherited from Control)
OnEndDragRaises the EndDrag event. (Inherited from ToolStrip)
OnEnterRaises the Enter event. (Inherited from Control)
OnFontChangedOverriden. Raises the FontChanged event. (Inherited from ToolStripDropDownMenu)
OnForeColorChangedRaises the ForeColorChanged event. (Inherited from Control)
OnGotFocusRaises the GotFocus event. (Inherited from Control)
OnHandleCreatedRaises the HandleCreated event. (Inherited from Control)
OnHandleDestroyedRaises the HandleDestroyed event. (Inherited from Control)
OnItemClickedOverriden. Raises the ItemClicked event. (Inherited from ToolStripDropDown)
OnKeyDownRaises the KeyDown event. (Inherited from Control)
OnKeyPressRaises the KeyPress event. (Inherited from Control)
OnKeyUpRaises the KeyUp event. (Inherited from Control)
OnLayoutOverriden. Raises the Layout event. (Inherited from ToolStripDropDownMenu)
OnLeaveOverriden. Raises the Leave event. (Inherited from ToolStrip)
OnLocationChangedRaises the LocationChanged event. (Inherited from Control)
OnLostFocusOverriden. Raises the LostFocus event. (Inherited from ToolStrip)
OnMouseDownOverriden. Raises the MouseDown event. (Inherited from ToolStrip)
OnMouseEnterRaises the MouseEnter event. (Inherited from Control)
OnMouseLeaveOverriden. Raises the MouseLeave event. (Inherited from ToolStrip)
OnMouseMoveOverriden. Raises the MouseMove event. (Inherited from ToolStrip)
OnMouseUpOverriden. Raises the MouseUp event. (Inherited from ToolStripDropDown)
OnMouseWheelRaises the MouseWheel event. (Inherited from Control)
OnMoveRaises the Move event. (Inherited from Control)
OnNCPaintOccurs when the non-client area of the control needs to be redrawn. (Inherited from Control)
OnOpenedRaises the Opened event. (Inherited from ToolStripDropDown)
OnOpeningRaises the Opening event. (Inherited from ToolStripDropDown)
OnPaintOverriden. Raises the Paint event. (Inherited from ToolStrip)
OnPaintBackgroundOverriden. Paints the background of the control. (Inherited from ToolStripDropDownMenu)
OnParentChangedOverriden. Raises the ParentChanged event. (Inherited from ToolStripDropDown)
OnParentEnabledChangedRaises the EnabledChanged event when the Enabled property value of the control's container changes. (Inherited from Control)
OnParentVisibleChangedRaises the VisibleChanged event when the Visible property value of the control's container changes. (Inherited from Control)
OnResizeRaises the Resize event. (Inherited from Control)
OnScrollInherited from ScrollableControl.
OnSizeChangedRaises the SizeChanged event. (Inherited from Control)
OnSkinChangedRaises the SkinChanged event. (Inherited from Control)
OnStyleChangedRaises the StyleChanged event. (Inherited from Control)
OnTabIndexChangedRaises the TabIndexChanged event. (Inherited from Control)
OnTabStopChangedRaises the TabStopChanged event. (Inherited from Control)
OnTextChangedRaises the TextChanged event. (Inherited from Control)
OnValidatedRaises the Validated event. (Inherited from Control)
OnValidatingRaises the Validating event. (Inherited from Control)
OnVisibleChangedOverriden. Raises the VisibleChanged event. (Inherited from ScrollableControl)
PerformLayoutOverloaded. Forces the control to apply layout logic to all its child controls. (Inherited from Control)
PointToClientComputes the location of the specified screen point into client coordinates. (Inherited from Control)
PointToScreenComputes the location of the specified client point into screen coordinates. (Inherited from Control)
ProcessDialogCharOverriden. Processes a dialog character. (Inherited from ToolStripDropDown)
ProcessDialogKeyOverriden. Processes a dialog key. (Inherited from ToolStripDropDown)
ProcessMnemonicOverriden. Processes a mnemonic character. (Inherited from ToolStrip)
RecreateHandleForces the re-creation of the handle for the control. (Inherited from Control)
RectangleToClientComputes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control)
RectangleToScreenComputes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control)
ReferenceEqualsDetermines whether the specified Object instances are the same instance. (Inherited from Object)
RefreshForces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control)
ResetBackColorResets the BackColor property to its default value. (Inherited from Control)
ResetCursorResets the Cursor property to its default value. (Inherited from Control)
ResetFontResets the Font property to its default value. (Inherited from Control)
ResetForeColorResets the ForeColor property to its default value. (Inherited from Control)
ResetSkinResets the Skin property to its default value. (Inherited from Control)
ResetTextResets the Text property to its default value. (Inherited from Control)
RestoreFocusControls the return location of the focus. (Inherited from ToolStrip)
ResumeLayoutOverloaded. Resumes normal layout logic. (Inherited from Control)
ScrollControlIntoViewScrolls the specified child control into view on a ScrollableControl object. (Inherited from ScrollableControl)
SelectOverloaded. Activates the control. (Inherited from Control)
SelectNextControlActivates the next control. (Inherited from Control)
SendToBackSends the control to the back of the z-order. (Inherited from Control)
SetAutoScrollMarginSets the size of the auto-scroll margins of the ScrollableControl. (Inherited from ScrollableControl)
SetBoundsOverloaded. Sets the bounds of the control to the specified location and size. (Inherited from Control)
SetBoundsCoreOverriden. Performs the work of setting the specified bounds of the ToolStrip. (Inherited from ToolStrip)
SetClientSizeCoreSets the size of the client area of the control. (Inherited from Control)
SetDisplayRectLocationSets the display location of the ScrollableControl. (Inherited from ScrollableControl)
SetNCSizeCoreSets the non-client area of the control. (Inherited from Control)
SetScrollStateSets the specified scroll state flag to the ScrollableControl. (Inherited from ScrollableControl)
SetStyleSets the specified style bit to the specified value. (Inherited from Control)
SetTopLevelSets the control as the top-level control. (Inherited from Control)
SetVisibleCoreOverriden. Sets the control to the specified visible state. (Inherited from ToolStripDropDown)
ShowOverloaded. (Inherited from Control)
SuspendLayoutTemporarily suspends the layout logic for the control. (Inherited from Control)
ToStringReturns a String that represents the current Object. (Inherited from Object)
UpdateCauses the control to redraw its client area if it was invalidated. (Inherited from Control)
UpdateBoundsOverloaded. Updates the bounds of the control with the current size and location. (Inherited from Control)
UpdateZOrderUpdates the control in its parent's z-order. (Inherited from Control)
PropertyDescription
AnchorGets or sets which edges of the control are anchored to the edges of its container. (Inherited from Control)
ApplicationAreaConstrainedInherited from ToolStripDropDown.
AutoScrollGets or sets a value indicating whether the container will allow the user to scroll to any controls placed outside of its visible boundaries. (Inherited from ScrollableControl)
AutoScrollMarginGets or sets the size of the auto-scroll margin. (Inherited from ScrollableControl)
AutoScrollMinSizeGets or sets the minimum size of the auto-scroll. (Inherited from ScrollableControl)
AutoScrollPositionGets or sets the location of the auto-scroll position. (Inherited from ScrollableControl)
BackColorGets or sets the background color for the control. (Inherited from Control)
BackVisualGets the visual of the control. (Inherited from Control)
BottomGets the distance between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control)
BoundsGets or sets the size and location of the control including its nonclient elements. (Inherited from Control)
CanFocusGets a value indicating whether the control can receive focus. (Inherited from Control)
CanOverflowGets a value indicating whether the items in the ToolStrip can be sent to an overflow menu. (Inherited from ToolStrip)
CanSelectGets a value indicating whether the control can be selected. (Inherited from Control)
CaptureGets or sets a value indicating whether the control has captured the mouse. (Inherited from Control)
CausesValidationGets or sets a value indicating whether the control causes validation for any controls that require validation when it receives focus. (Inherited from Control)
ClientRectangleGets the rectangle that represents the client area of the control. (Inherited from Control)
ClientSizeGets or sets the height and width of the client area of the control. (Inherited from Control)
ContainerGets the IContainer that contains the Component. (Inherited from Component)
ContainsFocusGets a value indicating whether the control or one of its child controls currently has the input focus. (Inherited from Control)
ControlSkinGets the ControlSkin of the control. (Inherited from Control)
ControlsGets the collection of controls contained within the control. (Inherited from Control)
CreatedGets a value indicating whether the control has been created. (Inherited from Control)
CursorGets or sets the cursor which is displayed when the mouse pointer is over the control. (Inherited from Control)
DefaultBackColorGets the default background color of the control. (Inherited from Control)
DefaultDockOverriden. Gets the docking location of the ToolStrip. (Inherited from ToolStripDropDown)
DefaultDropDownDirectionOverriden. Gets or sets a value that represents the default direction in which a ToolStripDropDown control is displayed relative to the ToolStrip. (Inherited from ToolStripDropDown)
DefaultFontGets the default font of the control. (Inherited from Control)
DefaultForeColorGets the default foreground color of the control. (Inherited from Control)
DefaultGripMarginGets the default spacing between the sizing grip and the edges of the ToolStrip. (Inherited from ToolStrip)
DefaultPaddingOverriden. Gets the spacing between the ToolStrip and the ToolStripContainer. (Inherited from ToolStripDropDownMenu)
DefaultSizeOverriden. Gets the default size of the control. (Inherited from ToolStrip)
DefaultSkinGets or sets the default skin of the control. (Inherited from Control)
DisplayRectangleOverriden. Gets the rectangle which represents the display area of the ScrollableControl. (Inherited from ToolStrip)
DisposingGets a value indicating whether the control is in the process of being disposed of. (Inherited from Control)
DockOverriden. Gets or sets which edge of the parent container a control is docked to. (Inherited from ToolStrip)
DockPaddingGets the dock padding settings for all edges of the ScrollableControl. (Inherited from ScrollableControl)
EnabledGets or sets a value indicating whether the control can react to user interaction. (Inherited from Control)
FocusedGets a value indicating whether the control has input focus. (Inherited from Control)
FontGets or sets the font of the text which is displayed by the control. (Inherited from Control)
ForeColorGets or sets the foreground color of the control. (Inherited from Control)
GripStyleGets or sets the ToolStripGripStyle is visible or hidden. (Inherited from ToolStrip)
HScrollGets or sets a value indicating whether the horizontal scroll bar of the ScrollableControl is visible. (Inherited from ScrollableControl)
HandleGets the native handle that the control is bound to. (Inherited from Control)
HasChildrenGets a value indicating whether the control has one or more child controls. (Inherited from Control)
HeightGets or sets the height of the control. (Inherited from Control)
ImageListGets or sets an ImageList to the ToolStrip to display image on the items. (Inherited from ToolStrip)
IsDisposedGets a value indicating whether the control has been disposed of. (Inherited from Control)
IsDropDownGets a value indicating whether a ToolStrip is a ToolStripDropDown control. (Inherited from ToolStrip)
IsHandleCreatedGets a value indicating whether the control has a handle associated with it. (Inherited from Control)
ItemsGets all the items of the ToolStrip. (Inherited from ToolStrip)
LeftGets or sets the horizontal coordinate of a control's left edge. (Inherited from Control)
LocationGets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control)
MaskVisualGets the Visual which is the mask of the control. (Inherited from Control)
MaxItemSizeOverriden. Gets the maximum height and width of the ToolStrip. (Inherited from ToolStripDropDownMenu)
ModifierKeysGets a value indicating when one of the modifier keys (SHIFT, CTRL, and ALT) is pressed. (Inherited from Control)
MouseButtonsGets a value indicating when one of the mouse buttons is clicked. (Inherited from Control)
MousePositionGets the position of the mouse cursor in global coordinates. (Inherited from Control)
NCVisualGets the non-client visual element of the control. (Inherited from Control)
NameGets or sets the name of the control. (Inherited from Control)
OrientationGets the orientation value of the ToolStrip. (Inherited from ToolStrip)
OverlayVisualGets a visual placed over everything. (Inherited from Control)
OwnerItemGets a ToolStripItem that is the owner of the ToolStripDropDown. (Inherited from ToolStripDropDown)
PaddingGets or sets the Padding of the ToolStrip. (Inherited from ToolStrip)
ParentGets or sets the parent container of the control. (Inherited from Control)
ParkedGets a value indicating whether the control is parked. (Inherited from Control)
RecreatingHandleGets a value indicating whether the control is currently re-creating its handle. (Inherited from Control)
RightGets the distance between the right edge of the control and the left edge of its container. (Inherited from Control)
ShowCheckMarginGets or sets a value indicating whether a check mark is shown on the left edge of the ToolStripMenuItem. (Inherited from ToolStripDropDownMenu)
ShowImageMarginGets or sets a value indicating whether space for an image is shown on the left edge of the ToolStripMenuItem. (Inherited from ToolStripDropDownMenu)
ShowItemToolTipsGets or sets a value indicating whether ToolTips of the items on the ToolStrip are displayed. (Inherited from ToolStrip)
SiteGets or sets the ISite of the Component. (Inherited from Component)
SizeGets or sets the height and width of the control. (Inherited from Control)
SkinGets or sets the skin of the control. (Inherited from Control)
StretchGets or sets a value indicating whether the ToolStrip stretches from end to end in the ToolStripContainer. (Inherited from ToolStrip)
SystemMenuGets or sets the SystemMenu of the control. (Inherited from Control)
TabIndexGets or sets the tab order of the control within its container. (Inherited from Control)
TabStopGets or sets a value indicating whether the user can use the TAB key to focus to the control. (Inherited from Control)
TagGets or sets the object that contains data about the control. (Inherited from Control)
TextGets or sets the text which is associated with the control. (Inherited from Control)
TopGets or sets the vertical coordinate of the control's top edge. (Inherited from Control)
TopLevelControlGets the parent control that is not parented by another Windows Forms control. (Inherited from Control)
VScrollGets or sets a value indicating whether the vertical scroll bar of the ScrollableControl is visible. (Inherited from ScrollableControl)
VisibleGets or sets a value indicating whether the control is visible. (Inherited from Control)
VisualGets the visual element of the control. (Inherited from Control)
WidthGets or sets the width of the control. (Inherited from Control)
EventDescription
BackColorChangedHandles the changes of the BackColor property. (Inherited from Control)
CausesValidationChangedHandles the changes of the CausesValidation property. (Inherited from Control)
ClickHandles the click event when the control is clicked. (Inherited from Control)
ClientSizeChangedInherited from Control.
ClosedHandles the close event of the ToolStripDropDown. (Inherited from ToolStripDropDown)
ClosingHandles the closing event of the ToolStripDropDown. (Inherited from ToolStripDropDown)
ControlAddedHandles the addition of a new control when it is added to the Control.ControlCollection. (Inherited from Control)
ControlRemovedHandles the remove of a control from the Control.ControlCollection. (Inherited from Control)
CursorChangedHandles the changes of the Cursor property. (Inherited from Control)
DisposedAdds an event handler to listen to the Disposed event on the component. (Inherited from Component)
DockChangedHandles the changes of the Dock property. (Inherited from Control)
DoubleClickHandles the double-clicked event of the control. (Inherited from Control)
EnabledChangedHandles the changes of the Enabled property. (Inherited from Control)
EnterHandles the entered event of the control. (Inherited from Control)
FontChangedHandles the changes of the Font property. (Inherited from Control)
ForeColorChangedHandles the changes of the ForeColor property. (Inherited from Control)
GotFocusHandles the focus reception of the control. (Inherited from Control)
HandleCreatedHandles the creation of a handle for the control. (Inherited from Control)
HandleDestroyedHandles the control's handle which is in the process of being destroyed. (Inherited from Control)
ItemClickedHandles the click event of the items of the ToolStrip. (Inherited from ToolStrip)
KeyDownHandles the pressed key event when a key is pressed and the control has focus. (Inherited from Control)
KeyPressHandles the pressed key event when a key is pressed and the control has focus. (Inherited from Control)
KeyUpHandles the release key event when a key is released and the control has focus. (Inherited from Control)
LayoutHandles the changes of control when it should reposition its child controls. (Inherited from Control)
LeaveHandles the input focus when it leaves the control. (Inherited from Control)
LocationChangedHandles the changes of the Location property. (Inherited from Control)
LostFocusHandles the focus on the control when it loses focus. (Inherited from Control)
MouseDownHandles the mouse event when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control)
MouseEnterHandles the mouse event when the mouse pointer enters the control. (Inherited from Control)
MouseLeaveHandles the mouse event when the mouse pointer leaves the control. (Inherited from Control)
MouseMoveHandles the mouse event when the mouse pointer is moved over the control. (Inherited from Control)
MouseUpHandles the mouse event when the mouse pointer is over the control and a mouse button is released. (Inherited from Control)
MouseWheelHandles the mouse event when the mouse wheel moves while the control has focus. (Inherited from Control)
MoveHandles the motion of the control when it is moved. (Inherited from Control)
OpenedHandles the open event of the ToolStripDropDown. (Inherited from ToolStripDropDown)
OpeningHandles the opening event of the ToolStripDropDown. (Inherited from ToolStripDropDown)
PaintHandles the paint event of the control when it is redrawn. (Inherited from Control)
ParentChangedHandles the changes of the Parent property. (Inherited from Control)
ResizeHandles the size changes of the control when it is resized. (Inherited from Control)
ScrollInherited from ScrollableControl.
SizeChangedHandles the changes of the Size property. (Inherited from Control)
SkinChangedHandles the changes of the Skin property. (Inherited from Control)
StyleChangedHandles the changes of the control style. (Inherited from Control)
TabIndexChangedHandles the changes of the TabIndex property. (Inherited from Control)
TabStopChangedHandles the changes of the TabStop property. (Inherited from Control)
TextChangedHandles the changes of the Text property. (Inherited from Control)
ValidatedHandles the validation of the control when it is finished validating. (Inherited from Control)
ValidatingHandles the validation of the control when it is validating. (Inherited from Control)
VisibleChangedDetermines the value of the VScroll property. (Inherited from Control)
ConstantDescription
ScrollState_AutoScrollingDetermines the value of the AutoScroll property. (Inherited from ScrollableControl)
ScrollState_HScrollVisibleDetermines the value of the HScroll property. (Inherited from ScrollableControl)
ScrollState_UserHasScrolledDetermines whether the user has scrolled the ScrollableControl. (Inherited from ScrollableControl)
ScrollState_VScrollVisibleDetermines the value of the VScroll property. (Inherited from ScrollableControl)

Inheritance Hierarchy

Object
Component
Control
ScrollableControl

Examples

// This sample shows how to implement the ContextMenuStrip class.

 

using System;

using System.Windows.Forms;

 

public class MyForm : System.Windows.Forms.Form

{

     MenuStrip menuStrip1;

     ToolStripMenuItem fileMenuItem;

     ToolStripMenuItem editMenuItem;

     ContextMenuStrip fileMenu;

     ContextMenuStrip editMenu;

 

     public MyForm() { InitializeComponent(); }

 

     private void InitializeComponent()

     {

          menuStrip1 = new System.Windows.Forms.MenuStrip();

          fileMenuItem = new ToolStripMenuItem("File");

          editMenuItem = new ToolStripMenuItem("Edit");

          SuspendLayout();

          menuStrip1.Dock= DockStyle.Top;

          menuStrip1.Items.Add( fileMenuItem );

          menuStrip1.Items.Add( editMenuItem );

 

          fileMenu= new System.Windows.Forms.ContextMenuStrip();

          ToolStripMenuItem newItem = new ToolStripMenuItem( "New" );

          newItem.Click += new EventHandler(on_item_clicked);

 

          fileMenu.Items.Add( newItem );

          fileMenu.Items.Add( new ToolStripMenuItem( "Open", -1, new EventHandler(on_item_clicked) ) );

          fileMenu.Items.Add( new ToolStripMenuItem( "Save", -1, new EventHandler(on_item_clicked) ) );

          fileMenu.Items.Add( new ToolStripMenuItem( "Exit", -1, new EventHandler(on_item_clicked) ) );

 

          editMenu= new System.Windows.Forms.ContextMenuStrip();

          editMenu.Items.Add( new ToolStripMenuItem( "Cut" , -1, new EventHandler(on_item_clicked) ) );

          editMenu.Items.Add( new ToolStripMenuItem( "Copy" , -1, new EventHandler(on_item_clicked) ) );

          editMenu.Items.Add( new ToolStripMenuItem( "Paste", -1, new EventHandler(on_item_clicked) ) );

 

          fileMenuItem.DropDown= fileMenu;

          editMenuItem.DropDown= editMenu;

          Controls.Add( menuStrip1 );

          ResumeLayout(false);

     }

 

     private void on_item_clicked( object sender, EventArgs e )

     {

          MessageBox.Show( "'" + ((ToolStripItem)sender).Text + "' clicked!" );

     }

     static void Main()

     {

          Application.Run( new MyForm() );

     }

}

Class Information

NamespaceSystem.Windows.Forms
Flash LibrarySystem.Windows.Forms.scl
Flash Library Version2.0.0.2118
Silverlight LibrarySystem.Windows.Forms.dll



© 2003-2007 NETiKA Technologies. All rights reserved.