Returns the next ContainerControl up the control's chain of parent controls. Retrieves the current lifetime service object that controls the lifetime policy for this instance. 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 BindingContextChanged event.
Raises the CausesValidationChanged event. Raises the ChangeUICues event. Raises the CheckedChanged event. Raises the Click event.
Raises the ClientSizeChanged 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 EnabledChanged event. Raises the Enter event.
Raises the FontChanged event. Raises the ForeColorChanged event. Raises the GiveFeedback event. Raises the GotFocus event. Raises the HandleDestroyed event. Raises the HelpRequested event. Raises the ImeModeChanged event. Raises the Invalidated event. Raises the KeyPress event. Raises the Layout event. Raises the Leave event. Raises the LocationChanged event. Raises the MarginChanged event. Raises the MouseCaptureChanged event.
Raises the MouseClick event. Raises the MouseDoubleClick event. Raises the MouseHover event. Raises the MouseUp event. Raises the MouseWheel event. Raises the Move event. Raises the PaddingChanged 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 Paint event. Raises the QueryContinueDrag event.
Raises the RegionChanged event. Raises the Resize event. Raises the RightToLeftChanged 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. Generates a Click event for the control, simulating a click by a user. Overrides the ProcessMnemonic Char method. Forces the control to invalidate its client area and immediately redraw itself and any child controls. 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 Button control to the state before it is pressed and redraws it. 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.
Overrides the ToString method. Occurs when the Appearance property value changes. Occurs when the value of the AutoSize property changes. Occurs when the value of the BackColor property changes.
Occurs when the value of the BackgroundImage property changes. Occurs when the BackgroundImageLayout property changes. Occurs when the value of the BindingContext property changes. Occurs when the value of the CausesValidation property changes. Occurs when the value of the Checked property changes. Occurs when the value of the ClientSize property changes. Occurs when the value of the ContextMenu property changes.
Occurs when the value of the ContextMenuStrip property changes. Occurs when a new control is added to the Control. Occurs when a control is removed from the Control.
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 value of the Dock property changes. Occurs when the user double-clicks the RadioButton control. Provides class handling for the ClickMode routed event that occurs when the mouse enters this control.
Provides class handling for the MouseLeave routed event that occurs when the mouse leaves an element. Provides class handling for the MouseLeftButtonDown routed event that occurs when the left mouse button is pressed while the mouse pointer is over this control. Provides class handling for the MouseLeftButtonUp routed event that occurs when the left mouse button is released while the mouse pointer is over this control.
Provides class handling for the MouseMove routed event that occurs when the mouse pointer moves while over this element. Invoked when an unhandled MouseRightButtonDown routed event reaches an element in its route that is derived from this class.
Invoked when an unhandled MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Invoked when an unhandled MouseUp routed event reaches an element in its route that is derived from this class. Invoked when an unhandled MouseWheel attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewDragEnter attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewDragLeave attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewDragOver attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewDrop attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewGiveFeedback attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewGotKeyboardFocus attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewKeyDown attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewKeyUp attached event reaches an element in its route that is derived from this class.
Raises the PreviewMouseDoubleClick routed event. Invoked when an unhandled PreviewMouseDown attached routed event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewMouseLeftButtonDown routed event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewMouseLeftButtonUp routed event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewMouseMove attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewMouseRightButtonDown routed event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewMouseRightButtonUp routed event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewMouseUp attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewMouseWheel attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewQueryContinueDrag attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewStylusButtonDown attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusButtonUp attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusDown attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusInAirMove attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewStylusInRange attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusMove attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewStylusOutOfRange attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusSystemGesture attached event reaches an element in its route that is derived from this class. Invoked when an unhandled PreviewStylusUp attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled PreviewTextInput attached event reaches an element in its route that is derived from this class. Provides class handling for the PreviewTouchDown routed event that occurs when a touch presses this element. Provides class handling for the PreviewTouchMove routed event that occurs when a touch moves while inside this element.
Provides class handling for the PreviewTouchUp routed event that occurs when a touch is released inside this element. Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Invoked when an unhandled QueryContinueDrag attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled QueryCursor attached event reaches an element in its route that is derived from this class.
When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.
Invoked when an unhandled StylusButtonDown attached event reaches an element in its route that is derived from this class. Invoked when an unhandled StylusButtonUp attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled StylusDown attached event reaches an element in its route that is derived from this class. Invoked when an unhandled StylusEnter attached event is raised by this element. Invoked when an unhandled StylusInAirMove attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled StylusInRange attached event reaches an element in its route that is derived from this class. Invoked when an unhandled StylusLeave attached event is raised by this element. Invoked when an unhandled StylusMove attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled StylusOutOfRange attached event reaches an element in its route that is derived from this class. Invoked when an unhandled StylusSystemGesture attached event reaches an element in its route that is derived from this class.
Invoked when an unhandled StylusUp attached event reaches an element in its route that is derived from this class. Invoked when an unhandled TextInput attached event reaches an element in its route that is derived from this class. Invoked whenever an unhandled ToolTipClosing routed event reaches this class in its route.
Invoked whenever the ToolTipOpening routed event reaches this class in its route. Provides class handling for the TouchDown routed event that occurs when a touch presses inside this element. Provides class handling for the TouchEnter routed event that occurs when a touch moves from outside to inside the bounds of this element. Provides class handling for the TouchLeave routed event that occurs when a touch moves from inside to outside the bounds of this UIElement.
Provides class handling for the TouchMove routed event that occurs when a touch moves while inside this element. Provides class handling for the TouchUp routed event that occurs when a touch is released inside this element. Called when the VisualCollection of the visual object is modified. Invoked when the parent of this element in the visual tree is changed.
Supports incremental layout implementations in specialized subclasses of FrameworkElement. ParentLayoutInvalidated UIElement is invoked when a child element has invalidated a property that is marked in metadata as affecting the parent's measure or arrange passes during layout. Converts a Point in screen coordinates into a Point that represents the current coordinate system of the Visual.
Converts a Point that represents the current coordinate system of the Visual into a Point in screen coordinates. Determines the next element that would receive focus relative to this element for a provided focus movement direction, but does not actually move the focus.
Raises a specific routed event. The RoutedEvent to be raised is identified within the RoutedEventArgs instance that is provided as the RoutedEvent property of that event data.
Provides an accessor that simplifies access to the NameScope registration method. Removes the provided object from this element's logical tree. FrameworkElement updates the affected logical tree parent pointers to keep in sync with this deletion. Attaches a binding to this element, based on the provided source property name as a path qualification to the data source.
Searches for a resource with the specified name and sets up a resource reference to it for the specified property. Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class. Indicates whether the Content property should be persisted.
Returns whether serialization processes should serialize the contents of the InputBindings property on instances of this class. Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. Returns whether serialization processes should serialize the contents of the Resources property. Returns whether serialization processes should serialize the contents of the Style property.
Returns whether serialization processes should serialize the contents of the Triggers property. Returns the string representation of a Control object. Returns a transform that can be used to transform coordinates from the Visual to the specified Visual ancestor of the visual object.
Returns a transform that can be used to transform coordinates from the Visual to the specified Visual3D ancestor of the visual object. Returns a transform that can be used to transform coordinates from the Visual to the specified visual object descendant. Returns a transform that can be used to transform coordinates from the Visual to the specified visual object.
Translates a point relative to this element to coordinates that are relative to the specified element. Simplifies access to the NameScope de-registration method. Reapplies the default style to the current FrameworkElement. Enforces that the calling thread has access to this DispatcherObject. Occurs when a Button is clicked. Occurs when the input system reports an underlying drag event with this element as the drag target. Occurs when the input system reports an underlying drag event with this element as the drag origin.
Occurs when the input system reports an underlying drag event with this element as the potential drop target. Occurs when the input system reports an underlying drop event with this element as the drop target.
Occurs when the value of the Focusable property changes. Occurs when the input system reports an underlying drag-and-drop event that involves this element.
Occurs when this FrameworkElement is initialized. This event coincides with cases where the value of the IsInitialized property changes from false or undefined to true. Occurs when the value of the IsEnabled property on this element changes. Occurs when the value of the IsHitTestVisible dependency property changes on this element.
Occurs when the value of the IsKeyboardFocused property changes on this element. Occurs when the value of the IsKeyboardFocusWithin property changes on this element. Occurs when the value of the IsMouseCaptured property changes on this element.
Occurs when the value of the IsMouseDirectlyOver property changes on this element. Occurs when the value of the IsStylusCaptured property changes on this element.
Occurs when the value of the IsStylusCaptureWithin property changes on this element. Occurs when the value of the IsStylusDirectlyOver property changes on this element. Occurs when the value of the IsVisible property changes on this element. Occurs when the layout of the various visual elements associated with the current Dispatcher changes.
Occurs when a manipulation and inertia on the UIElement object is complete. Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins.
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 type or 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. Button Class Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Raises the Validating event. Raises the VisibleChanged event.
Generates a Click event for a button. Forces the control to invalidate its client area and immediately redraw itself and any child controls. Provides constants for rescaling the Button control when a DPI change occurs. 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 Button control to the state before it is pressed and redraws it. 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.
Returns a String containing the name of the Component , if any. This method should not be overridden. Occurs when the value of the AutoSize property changes. Occurs when the value of the BackColor property changes. Occurs when the value of the BackgroundImage property changes. Occurs when the BackgroundImageLayout property changes. Occurs when the value of the BindingContext property changes. Occurs when the value of the CausesValidation property changes.
Occurs when the value of the ClientSize property changes. Occurs when the value of the ContextMenu property changes. Occurs when the value of the ContextMenuStrip property changes. Occurs when a new control is added to the Control. Occurs when a control is removed from the Control. 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 value of the Dock property changes.
Occurs when the user double-clicks the Button control. 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 Font property value changes. Occurs when the ForeColor property value changes. Occurs when the ImeMode property is changed. This event is not relevant for this class. Occurs when the Location property value has changed. Occurs when the user double-clicks the Button control with the mouse. 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.
Occurs when the value of the Region property changes. Occurs when the RightToLeft property value changes. Occurs when the Size property value changes. Occurs when the TabIndex property value changes. Occurs when the TabStop property value changes. Occurs when the Text property value changes. Occurs when the Visible property value changes. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.
Contents Exit focus mode. Button Class Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Namespace: System. Forms Assembly: System. Represents a Windows button control. In this article. Inherited from Control. Gets or sets the description of the control used by accessibility client applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control.
Gets or sets a value indicating whether the control can accept data that the user drags onto it. Inherited from ButtonBase. Gets or sets a value that indicates whether the control resizes based on its contents. Gets or sets the background color of the control. Gets or sets the background image displayed in the control.
Gets a value indicating whether the control can receive focus. Determines if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets or sets a value indicating whether the control has captured the mouse. Gets the rectangle that represents the client area of the control. Gets or sets the height and width of the client area of the control. Gets the name of the company or creator of the application containing the control.
Inherited from Component. Gets or sets the shortcut menu associated with the control. Gets the collection of controls contained within the control. Gets a value indicating whether the control has been created. Gets or sets the cursor that is displayed when the mouse pointer is over the control. Gets the data bindings for the control. Gets or sets the default cursor for the control. Gets the space, in pixels, that is specified by default between controls. Gets the internal spacing, in pixels, of the contents of a control.
Gets the default size of the control. Gets the DPI value for the display device where the control is currently being displayed. Gets or sets a value that is returned to the parent form when the button is clicked. Gets the rectangle that represents the display area of the control. Gets or sets a value indicating whether the control can respond to user interaction. Gets the appearance of the border and the colors used to indicate check state and mouse state.
Gets or sets the flat style appearance of the button control. Gets a value indicating whether the control has input focus. Gets or sets the font of the text displayed by the control. Gets or sets the height of the font of the control. Gets or sets the foreground color of the control. Gets the window handle that the control is bound to. Gets a value indicating whether the control contains one or more child controls.
Gets or sets the height of the control. Gets or sets the image that is displayed on a button control. Gets or sets the alignment of the image on the button control. Gets or sets the image list index value of the image displayed on the button control. Gets or sets the IME mode of a control.
Gets or sets a value indicating whether the control is visible to accessibility applications. Gets or sets a value indicating whether the button control is the default button. Gets a value indicating whether the control has been disposed of. Gets a value indicating whether the control has a handle associated with it. Gets a value indicating whether the control is mirrored. Gets a cached instance of the control's layout engine.
Gets or sets the space between controls. Gets or sets the name of the control. Gets or sets padding within the control. Gets or sets the parent container of the control. Gets the size of a rectangular area into which the control can fit. Gets the product name of the assembly containing the control. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services. Privacy policy. A button can send messages to its parent window, and a parent window can send messages to a button. To get information about a specific state, use a bitmask on the returned state value. It is designed for changing button styles within a type for example, changing a check box to an automatic check box. It is not designed for changing between types for example, changing a check box to a radio button.
An application should not change a button from one type to another. Information about which message is used can be found on the reference page for each notification. For more information on how to handle messages, see Control Messages. See also Button Messages. Both the message and the parent window's response depend on the type, style, and current state of the button.
0コメント