Меню Рубрики

System windows forms checkbox

Check Box Class

Definition

Represents a Windows CheckBox.

Examples

The following code example creates and initializes a CheckBox, gives it the appearance of a toggle button, sets AutoCheck to false , and adds it to a Form.

Remarks

Use a CheckBox to give the user an option, such as true/false or yes/no. The CheckBox control can display an image or text or both.

CheckBox and RadioButton controls have a similar function: they allow the user to choose from a list of options. CheckBox controls let the user pick a combination of options. In contrast, RadioButton controls allow a user to choose from mutually exclusive options.

The Appearance property determines whether the CheckBox appears as a typical CheckBox or as a button.

The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control.

If the ThreeState property is set to true , the Checked property will return true for either a checked or indeterminate state.

The FlatStyle property determines the style and appearance of the control. If the FlatStyle property is set to FlatStyle.System, the user’s operating system determines the appearance of the control.

When the FlatStyle property is set to FlatStyle.System, the CheckAlign property is ignored and the control is displayed using the ContentAlignment.MiddleLeft or ContentAlignment.MiddleRight alignment. If the CheckAlign property is set to one of the right alignments, the control is displayed using the ContentAlignment.MiddleRight alignment; otherwise, it is displayed using the ContentAlignment.MiddleLeft alignment.

The following describes an indeterminate state: You have a CheckBox that determines if the selected text in a RichTextBox is bold. When you select text you can click the CheckBox to bold the selection. Likewise, when you select some text, the CheckBox displays whether the selected text is bold. If your selected text contains text that is bold and normal, the CheckBox will have an indeterminate state.

Constructors

Initializes a new instance of the CheckBox class.

Properties

Gets the AccessibleObject assigned to the control.

Gets or sets the default action description of the control for use by accessibility client applications.

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.

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.

Gets or sets the value that determines the appearance of a CheckBox control.

Gets or set a value indicating whether the Checked or CheckState values and the CheckBox’s appearance are automatically changed when the CheckBox is clicked.

Gets or sets a value indicating whether the ellipsis character (. ) appears at the right edge of the control, denoting that the control text extends beyond the specified length of the control.

Gets or sets where this control is scrolled to in ScrollControlIntoView(Control).

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 or sets the background image layout as defined in the ImageLayout enumeration.

Gets or sets the BindingContext for the control.

Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container’s client area.

Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control.

Gets a value indicating whether the ImeMode property can be set to an active value, to enable IME support.

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 or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus.

Gets or sets the horizontal and vertical alignment of the check mark on a CheckBox control.

Gets or set a value indicating whether the CheckBox is in the checked state.

Gets or sets the state of the CheckBox.

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.

Gets the IContainer that contains the Component.

Gets a value indicating whether the control, or one of its child controls, currently has the input focus.

Gets or sets the shortcut menu associated with the control.

Gets or sets the ContextMenuStrip associated with this control.

Gets the collection of controls contained within the control.

Gets a value indicating whether the control has been created.

Gets the required creation parameters when the control handle is 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 default Input Method Editor (IME) mode supported by this control.

Gets the space, in pixels, that is specified by default between controls.

Gets the length and height, in pixels, that is specified as the default maximum size of a control.

Gets the length and height, in pixels, that is specified as the default minimum size of a control.

Gets the internal spacing, in pixels, of the contents of a control.

Gets the default size of the control.

Gets a value that indicates whether the Component is currently in design mode.

Gets the DPI value for the display device where the control is currently being displayed.

Gets the rectangle that represents the display area of the control.

Gets a value indicating whether the base Control class is in the process of disposing.

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.

Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker.

Gets or sets a value indicating whether the control can respond to user interaction.

Gets the list of event handlers that are attached to this Component.

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 key accessor for the image in the ImageList.

Gets or sets the ImageList that contains the Image displayed on a button control.

Gets or sets the Input Method Editor (IME) mode supported by this control. This property is not relevant for this class.

Gets or sets the IME mode of a control.

Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on.

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 distance, in pixels, between the left edge of the control and the left edge of its container’s client area.

Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container.

Gets or sets the space between controls.

Gets or sets the size that is the upper limit that GetPreferredSize(Size) can specify.

Gets or sets the size that is the lower limit that GetPreferredSize(Size) can specify.

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.

Gets the version of the assembly containing the control.

Gets a value indicating whether the control is currently re-creating its handle.

Gets or sets the window region associated with the control.

This property is now obsolete.

Gets or sets a value indicating whether the control redraws itself when resized.

Gets the distance, in pixels, between the right edge of the control and the left edge of its container’s client area.

Gets or sets a value indicating whether control’s elements are aligned to support locales using right-to-left fonts.

Gets a value that determines the scaling of child controls.

Gets a value indicating whether the control should display focus rectangles.

Gets a value indicating whether the user interface is in the appropriate state to show or hide keyboard accelerators.

Gets or sets the site of the control.

Gets or sets the height and width of the control.

Gets or sets the tab order of the control within its container.

Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.

Gets or sets the object that contains data about the control.

Gets or sets the text associated with this control.

Gets or sets the alignment of the text on the CheckBox control.

Gets or sets the position of text and image relative to each other.

Gets or sets a value indicating whether the CheckBox will allow three check states rather than two.

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 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 that determines whether to use the Graphics class (GDI+) or the TextRenderer class (GDI) to render text.

Gets or sets a value indicating whether the first character that is preceded by an ampersand (&) is used as the mnemonic key of the control.

Gets or sets a value that determines if the background is drawn using visual styles, if supported.

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 control and all its child controls are displayed.

Gets or sets the width of the control.

This property is not relevant for this class.

Methods

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control.

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control .

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.

Brings the control to the front of the z-order.

Retrieves a value indicating whether the specified control is a child of the control.

Creates a new accessibility object for the CheckBox control.

Forces the creation of the visible control, including the creation of the handle and any visible child controls.

Creates a new instance of the control collection for the control.

Creates the Graphics for the control.

Creates a handle for the control.

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

Sends the specified message to the default window procedure.

Destroys the handle associated with the control.

Releases all resources used by the Component.

Releases the unmanaged resources used by the ButtonBase and optionally releases the managed resources.

Begins a drag-and-drop operation.

Supports rendering to the specified bitmap.

Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed.

Determines whether the specified object is equal to the current object.

Retrieves the form that the control is on.

Sets input focus to the control.

Retrieves the specified AccessibleObject.

Retrieves a value indicating how a control will behave when its AutoSize property is enabled.

Retrieves the child control that is located at the specified coordinates.

Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type.

Returns the next ContainerControl up the control’s chain of parent controls.

Serves as the default hash function.

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

Retrieves the next control forward or back in the tab order of child controls.

Retrieves the size of a rectangular area into which a control can be fitted.

Retrieves the bounds within which the control is scaled.

Returns an object that represents a service provided by the Component or by its Container.

Retrieves the value of the specified control style bit for the control.

Determines if the control is a top-level control.

Gets the Type of the current instance.

Conceals the control from the user.

Obtains a lifetime service object to control the lifetime policy for this instance.

Called after the control has been added to another container.

Invalidates the entire surface of the control and causes the control to be redrawn.

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.

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. 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.

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. Optionally, invalidates the child controls assigned to the control.

Executes the specified delegate on the thread that owns the control’s underlying window handle.

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 if a character is an input character that the control recognizes.

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

Converts a Logical DPI value to its equivalent DeviceUnit DPI value.

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 OnMouseUp event.

Notifies the control of Windows messages.

Paints the background of the control.

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 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 RightToLeftChanged event when the RightToLeft property value of the control’s container changes.

Raises the VisibleChanged event when the Visible property value of the control’s container changes.

Forces the control to apply layout logic to all its child controls.

Forces the control to apply layout logic to all its child controls.

Computes the location of the specified screen point into client coordinates.

Computes the location of the specified client point into screen coordinates.

Preprocesses keyboard or input messages within the message loop before they are dispatched.

Preprocesses keyboard or input messages within the message loop before they are dispatched.

Processes a command key.

Processes a dialog character.

Processes a dialog key.

Processes a key message and generates the appropriate control events.

Processes a keyboard message.

Previews a keyboard message.

Processes a mnemonic character.

Raises the appropriate drag event.

Raises the appropriate key event.

Raises the appropriate mouse event.

Raises the appropriate paint event.

Forces the re-creation of the handle for the control.

Computes the size and location of the specified screen rectangle in client coordinates.

Computes the size and location of the specified client rectangle in screen coordinates.

Forces the control to invalidate its client area and immediately redraw itself and any child controls.

Provides constants for rescaling the CheckBox control when a DPI change occurs.

Provides constants for rescaling the 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).

Resumes usual layout logic.

Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.

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.

Converts the specified LeftRightAlignment to the appropriate LeftRightAlignment to support right-to-left text.

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.

Converts the specified LeftRightAlignment to the appropriate LeftRightAlignment to support right-to-left text.

Scales the control and any child controls.

Scales the entire control and any child controls.

Scales the control and all child controls by the specified scaling factor.

Scales a logical bitmap value to it’s equivalent device unit value when a DPI change occurs.

Scales a control’s location, size, padding and margin.

This method is not relevant for this class.

Activates the control.

Activates a child control. Optionally specifies the direction in the tab order to select the control from.

Activates the next control.

Sends the control to the back of the z-order.

Sets a value indicating how a control will behave when its AutoSize property is enabled.

Sets the bounds of the control to the specified location and size.

Sets the specified bounds of the control to the specified location and size.

Performs the work of setting the specified bounds of this control.

Sets the size of the client area of the control.

Sets a specified ControlStyles flag to either true or false .

Sets the control as the top-level control.

Sets the control to the specified visible state.

Displays the control to the user.

Determines the size of the entire control from the height and width of its client area.

Temporarily suspends the layout logic for the control.

Returns a string that represents the current CheckBox control.

Causes the control to redraw the invalidated regions within its client area.

Updates the bounds of the control with the current size and location.

Updates the bounds of the control with the specified size and location.

Updates the bounds of the control with the specified size, location, and client size.

Forces the assigned styles to be reapplied to the control.

Updates the control in its parent’s z-order.

Processes Windows messages.

Events

Occurs when the value of the Appearance property 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 focus or keyboard user interface (UI) cues change.

Occurs when the value of the Checked property changes.

Occurs when the value of the CheckState property changes.

Occurs when the control is clicked.

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.ControlCollection.

Occurs when a control is removed from the Control.ControlCollection.

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 CheckBox 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 a drag-and-drop operation is completed.

Occurs when an object is dragged into the control’s bounds.

Occurs when an object is dragged out of the control’s bounds.

Occurs when an object is dragged over the control’s bounds.

Occurs when the Enabled property value has changed.

Occurs when the control is entered.

Occurs when the Font property value changes.

Occurs when the ForeColor property value changes.

Occurs during a drag operation.

Occurs when the control receives focus.

Occurs when a handle is created for the control.

Occurs when the control’s handle is in the process of being destroyed.

Occurs when the user requests help for a control.

Occurs when the ImeMode property is changed. This event is not relevant for this class.

Occurs when a control’s display requires redrawing.

Occurs when a key is pressed while the control has focus.

Occurs when a character. space or backspace key is pressed while the control has focus.

Occurs when a key is released while the control has focus.

Occurs when a control should reposition its child controls.

Occurs when the input focus leaves the control.

Occurs when the Location property value has changed.

Occurs when the control loses focus.

Occurs when the control’s margin changes.

Occurs when the control loses mouse capture.

Occurs when the control is clicked by the mouse.

Occurs when the user double-clicks the CheckBox control.

Occurs when the control is double clicked by the mouse.

Occurs when the mouse pointer is over the control and a mouse button is pressed.

Occurs when the mouse pointer enters the control.

Occurs when the mouse pointer rests on the control.

Occurs when the mouse pointer leaves the control.

Occurs when the mouse pointer is moved over the control.

Occurs when the mouse pointer is over the control and a mouse button is released.

Occurs when the mouse wheel moves while the control has focus.

Occurs when the control is moved.

Occurs when the control’s padding changes.

Occurs when the control is redrawn.

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 control is resized.

Occurs when the RightToLeft property value changes.

Occurs when the Size property value changes.

Occurs when the control style changes.

Occurs when the system colors change.

Occurs when the TabIndex property value changes.

Occurs when the TabStop property value changes.

Occurs when the Text property value changes.

Occurs when the control is finished validating.

Occurs when the control is validating.

Occurs when the Visible property value changes.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • System windows forms button
  • System windows controls windows system
  • System transparency для windows 10
  • System toolbars как удалить windows 7
  • System recovery disk windows 7