System.windows.forms.contextmenu




















Occurs when an input device begins a manipulation on the UIElement object. Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. Occurs when the stylus moves while over the element. The stylus must move while being detected by the digitizer to raise this event, otherwise, PreviewStylusInAirMove is raised instead. Occurs when the cursor is requested to display. This event is raised on an element each time that the mouse pointer moves to a new location, which means the cursor object might need to be changed based on its new position.

Occurs when BringIntoView Rect is called on this element. Occurs when either the ActualHeight or the ActualWidth properties change value on this element. Occurs when the stylus moves over this element. The stylus must move while on the digitizer to raise this event. Otherwise, StylusInAirMove is raised instead. This member supports the Windows Presentation Foundation WPF infrastructure and is not intended to be used directly from your code. Skip to main content. This browser is no longer supported.

Download Microsoft Edge More info. Contents Exit focus mode. Context Menu Class Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Namespace: System. Controls Assembly: PresentationFramework. Note Setting a visual property only has an effect if that property is both present in the control's default template and is set by using a TemplateBinding.

In this article. Gets the rendered height of this element. Inherited from FrameworkElement. Gets the rendered width of this element. Inherited from UIElement.

Inherited from ItemsControl. Gets a value that indicates whether at least one touch is captured to this element. Gets a value that indicates whether at least one touch is pressed over this element.

Gets or sets a brush that describes the background of a control. Inherited from Control. Gets or sets a brush that describes the border background of a control. Gets or sets the border thickness of a control. Gets or sets the cursor that displays when the mouse pointer is over this element. Gets or sets the data context for an element when it participates in data binding. Inherited from DependencyObject. Gets the size that this element computed during the measure pass of the layout process.

Inherited from DispatcherObject. Gets or sets the font family of the control. Gets or sets the font size. Gets or sets the degree to which a font is condensed or expanded on the screen. Gets or sets the font style. Gets or sets the weight or thickness of the specified font.

Gets or sets a brush that describes the foreground color. Gets a value indicating whether this element has any animated properties. Gets or sets a value that indicates whether the context menu appears with a dropped shadow.

Gets or sets the suggested height of the element. Gets or sets the horizontal alignment of the control's content. Get or sets the horizontal distance between the target origin and the popup alignment point. Gets the collection of input bindings associated with this element.

Gets a value that indicates whether the control is using grouping. Gets a value indicating whether this element has keyboard focus. Gets a value that indicates whether this element has been loaded for presentation.

Gets a value indicating whether the current size returned by layout measure is valid. Gets a value that indicates whether this instance is currently sealed read-only. Gets or sets a value that indicates whether a control is included in tab navigation. Gets or sets a value that indicates whether case is a condition when searching for items. Gets or sets the custom logic for choosing a template used to display each item.

Inherited from MenuBase. Gets or sets the template that defines the panel that controls the layout of items. Gets or sets the outer margin of an element. Gets or sets the maximum height constraint of the element. Gets or sets the maximum width constraint of the element. Gets or sets the minimum height constraint of the element. Gets or sets the minimum width constraint of the element. Gets or sets the padding inside a control.

Gets the logical parent element of this element. Gets a value that uniquely identifies this element. Gets or sets the area relative to which the context menu is positioned when it opens. Gets or sets the final render size of this element. Gets or sets the locally-defined resource dictionary. Gets or sets the style used by this element when it is rendered. Gets a collection of all stylus plug-in customization objects associated with this element. Gets or sets a control template.

Gets or sets the tool-tip object that is displayed for this element in the user interface UI. Gets all touch devices that are captured to this element. Gets all touch devices that are over this element.

Gets all touch devices that are over this element or any child elements in its visual tree. Gets the collection of triggers established directly on this element, or in child elements. Gets or sets the vertical alignment of the control's content. Get or sets the vertical distance between the target origin and the popup alignment point. Gets or sets the user interface UI visibility of this element. Inherited from Visual. Gets the number of visual child elements within this element.

Gets or sets the offset value of the visual object. Gets the visual tree parent of the visual object. Gets or sets the x-coordinate vertical guideline collection. Gets or sets the y-coordinate horizontal guideline collection. Gets or sets the width of the element. AddChild Object. AddHandler RoutedEvent, Delegate. AddLogicalChild Object. Adds the provided object to the logical tree of this element. AddText String. AddVisualChild Visual. Defines the parent-child relationship between two visuals.

Arrange Rect. ArrangeCore Rect. ArrangeOverride Size. Starts an animation for a specified animated property on this element. BeginStoryboard Storyboard. Begins the sequence of actions that are contained in the provided storyboard.

BeginStoryboard Storyboard, HandoffBehavior. Attempts to bring this element into view, within any scrollable regions it is contained within. BringIntoView Rect. Attempts to force capture of the mouse to this element. Attempts to force capture of the stylus to this element. CaptureTouch TouchDevice.

Attempts to force capture of a touch to this element. ClearValue DependencyProperty. ClearValue DependencyPropertyKey. CoerceValue DependencyProperty. ContainerFromElement DependencyObject. Equals Object. Returns the common ancestor of two visual objects. FindName String.

Finds an element that has the provided identifier name. FindResource Object. Attempts to set focus to this element. GetBindingExpression DependencyProperty. Creates or identifies the element used to display the specified item. GetLayoutClip Size.

GetTemplateChild String. Inherited from Object. Returns an alternative logical parent for this element if there is no visual parent. GetValue DependencyProperty. GetVisualChild Int Called when a mouse button is pressed or released. InputHitTest Point. Invalidates the measurement state layout for the element. InvalidateProperty DependencyProperty. Re-evaluates the effective value for the specified dependency property. IsAncestorOf DependencyObject.

Determines whether the visual object is an ancestor of the descendant visual object. IsDescendantOf DependencyObject. Determines whether the visual object is a descendant of the ancestor visual object. Determines if the specified item is or is eligible to be its own container. Determines whether the specified item is, or is eligible to be, its own item container. Measure Size.

MeasureCore Size. MeasureOverride Size. Called to remeasure a control. MoveFocus TraversalRequest. Provides class handling for when an access key that is meaningful for this element is invoked.

Supports layout behavior when a child element is resized. OnClosed RoutedEventArgs. Called when the DPI at which this View is rendered changes. OnDrop DragEventArgs. OnInitialized EventArgs. OnOpened RoutedEventArgs. OnRender DrawingContext. OnStyleChanged Style, Style. Invoked when the style in use on this element changes, which will invalidate the layout. Called whenever the control's template changes. PointFromScreen Point.

PointToScreen Point. PredictFocus FocusNavigationDirection. RaiseEvent RoutedEventArgs. ReadLocalValue DependencyProperty. Returns the local value of a dependency property, if it exists. RegisterName String, Object. Releases all captured touch devices from this element.

Releases the mouse capture, if this element held the capture. Releases the stylus device capture, if this element held the capture. ReleaseTouchCapture TouchDevice. Attempts to release the specified touch device from this element. RemoveHandler RoutedEvent, Delegate. Removes the specified routed event handler from this element. RemoveLogicalChild Object. RemoveVisualChild Visual. Removes the parent-child relationship between two visuals. Attaches a binding to this element, based on the provided binding object.

SetBinding DependencyProperty, String. Sets the value of a dependency property without changing its value source. SetValue DependencyProperty, Object. Sets the local value of a dependency property, specified by its dependency property identifier.

ShouldSerializeProperty DependencyProperty. TransformToAncestor Visual. TransformToAncestor Visual3D. TransformToDescendant Visual. TransformToVisual Visual. TryFindResource Object. Searches for a resource with the specified key, and returns that resource if found. UnregisterName String.

Ensures that all visual child elements of this element are properly updated for layout. Occurs just before any context menu on the element is closed. Occurs when any context menu on the element is opened. Occurs when the data context for this element changes. Occurs when this element gets logical focus. Occurs when the keyboard is focused on this element. Occurs when this element captures the mouse.

Occurs when this element captures the stylus. Occurs when a touch is captured to this element. Occurs when a key is pressed while focus is on this element. Occurs when a key is released while focus is on this element.

Occurs when the element is laid out, rendered, and ready for interaction. Occurs when this element loses logical focus. View All. Deepak Sharma Updated date Nov 19, For example, type "Exit" and press Enter Double-click on the menu item Exit to write code for its Click event.

Add menuItem ; this. In code behind, write the following to do the same, to add multiple keys separate them using "or" the Pipe character : menuItem. X; By default, shortcut keys are shown with the menu item. Unchecked; see: menuItem. Next Recommended Reading. Net Core 6. Create A. Understanding Thread Starvation in. NET Core Applications.

Exploring Numeric Streams In Java. Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. Gets or sets a value indicating whether the ToolStripDropDown is a top-level control. Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in.

Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. Gets or sets a value indicating whether the ToolStripDropDown is visible or hidden. Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control.

Adjusts the scroll bars on the container based on the current control positions and the control currently selected. Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on.

Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. Closes the ToolStripDropDown control. Closes the ToolStripDropDown control for the specified reason. Creates a new accessibility object for the ToolStripDropDown. Forces the creation of the visible control, including the creation of the handle and any visible child controls.

Creates the Graphics for the control. Applies various layout options to the ToolStripDropDown. Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. Releases all resources used by the Component. Releases the unmanaged resources used by the ContextMenuStrip and optionally releases the managed resources. Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed.

Retrieves the specified AccessibleObject. Retrieves a value indicating how a control will behave when its AutoSize property is enabled. Returns the next ContainerControl up the control's chain of parent controls.

Returns the item located at the specified x- and y-coordinates of the ToolStrip client area. Returns the item located at the specified point in the client area of the ToolStrip. Retrieves the current lifetime service object that controls the lifetime policy for this instance. Retrieves the next ToolStripItem from the specified reference point and moving in the specified direction.

Returns an object that represents a service provided by the Component or by its Container. Gets the Type of the current instance.

Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. Invalidates the specified region of the control adds it to the control's update region, which is the area that will be repainted at the next paint operation , and causes a paint message to be sent to the control.

Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. Raises the GotFocus event for the specified control. Raises the LostFocus event for the specified control. Raises the Click event for the specified control. Raises the Paint event for the specified control. Raises the PaintBackground event for the specified control. Determines whether the specified key is a regular input key or a special key that requires preprocessing.

Transforms a size from logical to device units by scaling it for the current DPI and rounding down to the nearest integer value for width and height.

Creates a shallow copy of the current Object. Creates a shallow copy of the current MarshalByRefObject object. Raises the Invalidated event with a specified region of the control to invalidate. Raises the AutoSizeChanged event. Raises the BackColorChanged event. Raises the BackgroundImageChanged event. Raises the BackgroundImageLayoutChanged event. Raises the BeginDrag event. Raises the BindingContextChanged event. Raises the CausesValidationChanged event. Raises the ChangeUICues event. Raises the Click event.

Raises the ClientSizeChanged event. Raises the Closed event. Raises the Closing event. Raises the ContextMenuChanged event. Raises the ContextMenuStripChanged event. Raises the ControlAdded event. Raises the ControlRemoved event. Raises the CreateControl method. Raises the CursorChanged event.

Raises the DockChanged event. Raises the DoubleClick event. Raises the DpiChangedAfterParent event. Raises the DpiChangedBeforeParent event. Raises the DragDrop event.

Raises the DragEnter event. Raises the DragLeave event. Raises the DragOver event. Raises the Enabled event. Raises the EndDrag event. Raises the Enter event. Raises the FontChanged event. Raises the ForeColorChanged event. Raises the GiveFeedback event. Raises the GotFocus event. Raises the HandleCreated event. Raises the HandleDestroyed event.

Raises the HelpRequested event. Raises the ImeModeChanged event. Raises the Invalidated event. Raises the ItemAdded event. Raises the ItemClicked event. Raises the ItemRemoved event. Raises the KeyDown event. Raises the KeyPress event. Raises the KeyUp event. Raises the Layout event. Raises the LayoutCompleted event. Raises the LayoutStyleChanged event. Raises the Leave event. Raises the LocationChanged event.

Raises the LostFocus event. Raises the MarginChanged event. Raises the MouseCaptureChanged event. Raises the MouseClick event. Raises the MouseDoubleClick event. Raises the MouseDown event. Raises the MouseEnter event. Raises the MouseHover event. Raises the MouseLeave event.

Raises the MouseMove event. Raises the MouseUp event. Raises the MouseWheel event. Raises the Move event. Raises the Opened event. Raises the Opening event. Raises the PaddingChanged event. Raises the Paint event. Raises the PaintGrip event. Raises the BackColorChanged event when the BackColor property value of the control's container changes. Raises the BackgroundImageChanged event when the BackgroundImage property value of the control's container changes.

Raises the BindingContextChanged event when the BindingContext property value of the control's container changes. Raises the ParentChanged event. Raises the EnabledChanged event when the Enabled property value of the control's container changes.

Raises the FontChanged event when the Font property value of the control's container changes. Raises the ForeColorChanged event when the ForeColor property value of the control's container changes. Raises the VisibleChanged event when the Visible property value of the control's container changes.

Raises the PreviewKeyDown event. Raises the QueryContinueDrag event. Raises the RegionChanged event. Raises the RendererChanged event.

Raises the Resize event. Raises the RightToLeftChanged event. Raises the Scroll event. Raises the SizeChanged event. Raises the StyleChanged event. Raises the SystemColorsChanged event. Raises the TabIndexChanged event. Raises the TabStopChanged event. Raises the TextChanged event. Raises the Validated event. Raises the Validating event. Raises the VisibleChanged event. Forces the control to invalidate its client area and immediately redraw itself and any child controls.

When overridden in a derived class, handles the rescaling of any magic numbers that are used in control painting. Resets the BackColor property to its default value. Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. Resets the Cursor property to its default value. Resets the Font property to its default value. Resets the ForeColor property to its default value.

Resets the ImeMode property to its default value. Resets the control to handle the MouseLeave event. Resets the RightToLeft property to its default value. Resets the Text property to its default value Empty.

Converts the specified ContentAlignment to the appropriate ContentAlignment to support right-to-left text. Converts the specified HorizontalAlignment to the appropriate HorizontalAlignment to support right-to-left text. Activates a child control. Optionally specifies the direction in the tab order to select the control from. Sets a value indicating how a control will behave when its AutoSize property is enabled. Sets a specified ControlStyles flag to either true or false.

Displays the ToolStripDropDown control in its default position. Positions the ToolStripDropDown relative to the specified control's horizontal and vertical screen coordinates. Positions the ToolStripDropDown relative to the specified control location. Positions the ToolStripDropDown relative to the specified control at the specified location and with the specified direction relative to the parent control.

Positions the ToolStripDropDown relative to the specified screen coordinates. Positions the ToolStripDropDown relative to the specified screen location. Positions the ToolStripDropDown relative to the specified control location and with the specified direction relative to the parent control. Returns a string that represents the ToolStrip control. Occurs when the AutoSize property has changed. Occurs when the value of the BackColor property changes.

Occurs when the value of the BackgroundImage property changes. Occurs when the user begins to drag the ToolStrip control. Occurs when the value of the BindingContext property changes. Occurs when the CausesValidation property changes. Occurs when the value of the ClientSize property changes.

Occurs when the ToolStripDropDown is closed. Occurs when the ToolStripDropDown control is about to close. Occurs when the value of the Cursor property changes. Occurs when the component is disposed by a call to the Dispose method. Occurs when the DPI setting for a control is changed programmatically after the DPI of its parent control or form has changed.

Occurs when the DPI setting for a control is changed programmatically before a DPI change event for its parent control or form has occurred. Occurs when the Enabled property value has changed. Occurs when the user stops dragging the ToolStrip control. Occurs when the focus enters the ToolStripDropDown. Occurs when the value of the Font property changes. Occurs when the value of the ForeColor property changes. Occurs when the ImeModeChanged property has changed. Occurs when the ToolStripItem is clicked.

Occurs when a key is pressed and held down while the ToolStripDropDown has focus. Occurs when a key is pressed while the ToolStripDropDown has focus. Occurs when the layout of the ToolStrip is complete. Occurs when the value of the LayoutStyle property changes. Occurs when the Location property value has changed.

Occurs when the ToolStripDropDown is opened. Occurs when the ToolStripDropDown control is opening. Occurs when the ToolStrip move handle is painted. Occurs when the Parent property value changes.

Occurs before the KeyDown event when a key is pressed while focus is on this control. Occurs when AccessibleObject is providing help to accessibility applications.

Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.



0コメント

  • 1000 / 1000