Control 类
定义
定义控件的基类,控件是带有可视化表示形式的组件。Defines the base class for controls, which are components with visual representation.
public ref class Control : System::ComponentModel::Component, IDisposable, System::ComponentModel::ISynchronizeInvoke, System::Windows::Forms::IBindableComponent, System::Windows::Forms::IDropTarget, System::Windows::Forms::IWin32Window
public ref class Control : System::ComponentModel::Component, System::ComponentModel::ISynchronizeInvoke, System::Windows::Forms::IWin32Window
public class Control : System.ComponentModel.Component, IDisposable, System.ComponentModel.ISynchronizeInvoke, System.Windows.Forms.IBindableComponent, System.Windows.Forms.IDropTarget, System.Windows.Forms.IWin32Window
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class Control : System.ComponentModel.Component, IDisposable, System.ComponentModel.ISynchronizeInvoke, System.Windows.Forms.IBindableComponent, System.Windows.Forms.IDropTarget, System.Windows.Forms.IWin32Window
public class Control : System.ComponentModel.Component, System.ComponentModel.ISynchronizeInvoke, System.Windows.Forms.IWin32Window
type Control = class
inherit Component
interface Interop.Ole32.IOleControl
interface Interop.Ole32.IOleObject
interface Interop.Ole32.IOleInPlaceObject
interface Interop.Ole32.IOleInPlaceActiveObject
interface Interop.Ole32.IOleWindow
interface Interop.Ole32.IViewObject
interface Interop.Ole32.IViewObject2
interface Interop.Ole32.IPersist
interface Interop.Ole32.IPersistStreamInit
interface Interop.Oleaut32.IPersistPropertyBag
interface Interop.Ole32.IPersistStorage
interface Interop.Ole32.IQuickActivate
interface IDropTarget
interface ISynchronizeInvoke
interface IWin32Window
interface IComponent
interface IDisposable
interface IBindableComponent
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Control = class
inherit Component
interface UnsafeNativeMethods.IOleControl
interface UnsafeNativeMethods.IOleObject
interface UnsafeNativeMethods.IOleInPlaceObject
interface UnsafeNativeMethods.IOleInPlaceActiveObject
interface UnsafeNativeMethods.IOleWindow
interface UnsafeNativeMethods.IViewObject
interface UnsafeNativeMethods.IViewObject2
interface UnsafeNativeMethods.IPersist
interface Interop.Ole32.IPersistStreamInit
interface UnsafeNativeMethods.IPersistPropertyBag
interface Interop.Ole32.IPersistStorage
interface UnsafeNativeMethods.IQuickActivate
interface IDropTarget
interface ISynchronizeInvoke
interface IWin32Window
interface IComponent
interface IDisposable
interface IBindableComponent
type Control = class
inherit Component
interface UnsafeNativeMethods.IOleControl
interface UnsafeNativeMethods.IOleObject
interface UnsafeNativeMethods.IOleInPlaceObject
interface UnsafeNativeMethods.IOleInPlaceActiveObject
interface UnsafeNativeMethods.IOleWindow
interface UnsafeNativeMethods.IViewObject
interface UnsafeNativeMethods.IViewObject2
interface UnsafeNativeMethods.IPersist
interface UnsafeNativeMethods.IPersistStreamInit
interface UnsafeNativeMethods.IPersistPropertyBag
interface UnsafeNativeMethods.IPersistStorage
interface UnsafeNativeMethods.IQuickActivate
interface ISynchronizeInvoke
interface IWin32Window
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Control = class
inherit Component
interface UnsafeNativeMethods.IOleControl
interface UnsafeNativeMethods.IOleObject
interface UnsafeNativeMethods.IOleInPlaceObject
interface UnsafeNativeMethods.IOleInPlaceActiveObject
interface UnsafeNativeMethods.IOleWindow
interface UnsafeNativeMethods.IViewObject
interface UnsafeNativeMethods.IViewObject2
interface UnsafeNativeMethods.IPersist
interface UnsafeNativeMethods.IPersistStreamInit
interface UnsafeNativeMethods.IPersistPropertyBag
interface UnsafeNativeMethods.IPersistStorage
interface UnsafeNativeMethods.IQuickActivate
interface IDropTarget
interface ISynchronizeInvoke
interface IWin32Window
interface IBindableComponent
interface IComponent
interface IDisposable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Control = class
inherit Component
interface IDropTarget
interface ISynchronizeInvoke
interface IWin32Window
interface IBindableComponent
interface IComponent
interface IDisposable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Control = class
inherit Component
interface IDropTarget
interface ISynchronizeInvoke
interface IWin32Window
interface IComponent
interface IDisposable
interface IBindableComponent
Public Class Control
Inherits Component
Implements IBindableComponent, IDisposable, IDropTarget, ISynchronizeInvoke, IWin32Window
Public Class Control
Inherits Component
Implements ISynchronizeInvoke, IWin32Window
- 继承
- 派生
- 属性
- 实现
注解
若要创建自己的控件类,请从 UserControl 、 Control 类或从其他 Windows 窗体提供的控件继承。To create your own control class, inherit from the UserControl, Control classes, or from the other Windows Forms provided controls. 有关创作自定义控件的详细信息,请参阅 用 .NET Framework 开发自定义 Windows 窗体控件。For more information about authoring custom controls, see Developing Custom Windows Forms Controls with the .NET Framework.
Control类实现向用户显示信息的类所需的非常基本的功能。The Control class implements very basic functionality required by classes that display information to the user. 它通过键盘和指针设备处理用户输入。It handles user input through the keyboard and pointing devices. 它处理消息路由和安全性。It handles message routing and security. 它定义控件的边界 (其位置和大小) ,尽管它不实现绘制。It defines the bounds of a control (its position and size), although it does not implement painting. 它提供 () 的窗口句柄 hWnd
。It provides a window handle (hWnd
).
Windows 窗体控件使用环境属性,使子控件看起来就像它们的周围环境。Windows Forms controls use ambient properties so child controls can appear like their surrounding environment. 环境属性是一个控件属性,如果未设置,则将从父控件中检索该属性。An ambient property is a control property that, if not set, is retrieved from the parent control. 如果控件没有 Parent ,并且未设置属性,则控件会尝试通过属性确定环境属性的值 Site 。If the control does not have a Parent, and the property is not set, the control attempts to determine the value of the ambient property through the Site property. 如果该控件未放置,则为; 如果该站点不支持环境属性,或者未在上设置该属性 AmbientProperties ,则该控件将使用其自己的默认值。If the control is not sited, if the site does not support ambient properties, or if the property is not set on the AmbientProperties, the control uses its own default values. 通常,环境属性表示控件(例如)的特性,这些特性 BackColor 会传达给子控件。Typically, an ambient property represents a characteristic of a control, such as BackColor, that is communicated to a child control. 例如, Button BackColor 默认情况下,将与其父级相同 Form 。For example, a Button will have the same BackColor as its parent Form by default. 类提供的环境属性 Control 包括: Cursor 、 Font 、 BackColor 、 ForeColor 和 RightToLeft 。Ambient properties provided by the Control class include: Cursor, Font, BackColor, ForeColor, and RightToLeft.
备注
若要使 Windows 窗体的应用程序支持视觉样式,请确保将 FlatStyle 属性设置为 System
,并将清单包含在可执行文件中。To make your Windows Forms application support visual styles, be sure to set the FlatStyle property to System
and include a manifest with your executable. 清单是一个 XML 文件,其中包含为应用程序可执行文件中的资源,或者作为与可执行文件位于同一目录中的单独文件。A manifest is an XML file that is included either as a resource within your application executable or as a separate file that resides in the same directory as the executable file. 有关清单的示例,请参见枚举的 "示例" 部分 FlatStyle 。For an example of a manifest, see the Example section of the FlatStyle enumeration. 有关使用视觉样式的详细信息,请参阅 视觉样式。For more information about using visual styles, see Visual Styles.
Windows 窗体内置了辅助功能支持,并提供了有关应用程序的信息,使其能够与辅助功能客户端应用程序(如屏幕弱视和审阅者实用程序、语音输入实用程序、屏幕键盘、备用输入设备和键盘增强实用程序)配合工作。Windows Forms has accessibility support built in, and provides information about your application that enables it to work with accessibility client applications such as screen enlarger and reviewer utilities, voice input utilities, on-screen keyboards, alternative input devices, and keyboard enhancement utilities. 有时,你将需要向具有辅助功能的客户端应用程序提供其他信息。Sometimes you will want to provide additional information to accessibility client applications. 提供此附加信息的方法有两种。There are two ways of providing this additional information. 你可以设置 AccessibleName 、 AccessibleDescription 、 AccessibleDefaultActionDescription 和 AccessibleRole 属性值,这些值将报告给具有辅助功能的客户端应用程序。You can set the AccessibleName, AccessibleDescription, AccessibleDefaultActionDescription, and AccessibleRole property values, which will be reported to accessibility client applications. 此方法通常用于提供现有控件的有限辅助功能信息。This method is typically used to provide limited accessibility information for existing controls. 或者,你可以编写自己的派生自 AccessibleObject 或类的类 Control.ControlAccessibleObject ,并根据需要提供尽可能多的辅助功能信息。Alternatively, you can write your own class deriving from the AccessibleObject or Control.ControlAccessibleObject classes, providing as much accessibility information as needed.
备注
若要保持更好的性能,请不要在其构造函数中设置控件的大小。To maintain better performance, do not set the size of a control in its constructor. 首选方法是重写 DefaultSize 属性。The preferred method is to override the DefaultSize property.
备注
不要 Control 在其构造函数中添加的数据绑定。Do not add data bindings for a Control in its constructor. 这样做将导致代码生成出错,并可能导致意外的行为。Doing so will cause errors in code generation and can cause unwanted behavior.
命名空间中的大部分控件都 System.Windows.Forms 使用基础 Windows 公共控件作为生成的基础。The majority of the controls in the System.Windows.Forms namespace use the underlying Windows common control as a base to build on. 有关 Windows 公共控件的详细信息,请参阅 常规控件参考。For more information about the Windows common controls, see General Control Reference.
若要从单独的进程中标识 Windows 窗体控件,请使用标准 SendMessage
调用传递 WM_GETCONTROLNAME 消息。To identify Windows Forms controls from a separate process, use a standard SendMessage
call to pass the WM_GETCONTROLNAME message. WM_GETCONTROLNAME 独立于语言和 Windows 层次结构。WM_GETCONTROLNAME is independent of the language and Windows hierarchy. 有关详细信息,请参阅 自动 Windows 窗体中的 "Windows 窗体推荐的解决方案" 主题。For more information, see the "Recommended Solution for Windows Forms" topic in Automating Windows Forms.
使用 InvokeRequired 属性可以从多个线程同步对控件的访问。Use the InvokeRequired property to synchronize access to the control from multiple threads. 有关多线程 Windows 窗体控件的详细信息,请参阅 如何:对 Windows 窗体控件进行 Thread-Safe 调用For more information about multithreaded Windows Forms controls, see How to: Make Thread-Safe Calls to Windows Forms Controls
构造函数
Control() |
使用默认设置初始化 Control 类的新实例。Initializes a new instance of the Control class with default settings. |
Control(Control, String) |
用特定文本将 Control 类的新实例初始化为子控件。Initializes a new instance of the Control class as a child control, with specific text. |
Control(Control, String, Int32, Int32, Int32, Int32) |
用特定的文本、大小和位置将 Control 类的新实例初始化为子控件。Initializes a new instance of the Control class as a child control, with specific text, size, and location. |
Control(String) |
用特定的文本初始化 Control 类的新实例。Initializes a new instance of the Control class with specific text. |
Control(String, Int32, Int32, Int32, Int32) |
用特定的文本、大小和位置初始化 Control 类的新实例。Initializes a new instance of the Control class with specific text, size, and location. |
属性
AccessibilityObject |
获取分配给该控件的 AccessibleObject。Gets the AccessibleObject assigned to the control. |
AccessibleDefaultActionDescription |
获取或设置控件的默认操作说明以供具有辅助功能的客户端应用程序使用。Gets or sets the default action description of the control for use by accessibility client applications. |
AccessibleDescription |
获取或设置辅助功能客户端应用程序使用的控件说明。Gets or sets the description of the control used by accessibility client applications. |
AccessibleName |
获取或设置辅助功能客户端应用程序所使用的控件名称。Gets or sets the name of the control used by accessibility client applications. |
AccessibleRole |
获取或设置控件的辅助性角色。Gets or sets the accessible role of the control. |
AllowDrop |
获取或设置一个值,该值指示控件是否可以接受用户拖放到它上面的数据。Gets or sets a value indicating whether the control can accept data that the user drags onto it. |
Anchor |
获取或设置控件绑定到的容器的边缘并确定控件如何随其父级一起调整大小。Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. |
AutoScrollOffset |
获取或设置一个值,该值指示在 ScrollControlIntoView(Control) 中将控件滚动到何处。Gets or sets where this control is scrolled to in ScrollControlIntoView(Control). |
AutoSize |
此属性与此类无关。This property is not relevant for this class. |
BackColor |
获取或设置控件的背景色。Gets or sets the background color for the control. |
BackgroundImage |
获取或设置在控件中显示的背景图像。Gets or sets the background image displayed in the control. |
BackgroundImageLayout |
获取或设置在 ImageLayout 枚举中定义的背景图像布局。Gets or sets the background image layout as defined in the ImageLayout enumeration. |
BindingContext |
获取或设置控件的 BindingContext。Gets or sets the BindingContext for the control. |
Bottom |
获取控件下边缘与其容器的工作区上边缘之间的距离(以像素为单位)。Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. |
Bounds |
获取或设置控件(包括其非工作区元素)相对于其父控件的大小和位置(以像素为单位)。Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. |
CanEnableIme |
获取一个用以指示是否可以将 ImeMode 属性设置为活动值的值,以启用 IME 支持。Gets a value indicating whether the ImeMode property can be set to an active value, to enable IME support. |
CanFocus |
获取一个值,该值指示控件是否可以接收焦点。Gets a value indicating whether the control can receive focus. |
CanRaiseEvents |
确定是否可以在控件上引发事件。Determines if events can be raised on the control. |
CanRaiseEvents |
获取一个指示组件是否可以引发事件的值。Gets a value indicating whether the component can raise an event. (继承自 Component) |
CanSelect |
获取一个值,该值指示是否可以选中控件。Gets a value indicating whether the control can be selected. |
Capture |
获取或设置一个值,该值指示控件是否已捕获鼠标。Gets or sets a value indicating whether the control has captured the mouse. |
CausesValidation |
获取或设置一个值,该值指示控件是否会引起在任何需要在接收焦点时执行验证的控件上执行验证。Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. |
CheckForIllegalCrossThreadCalls |
获取或设置一个值,该值指示是否捕获对错误线程的调用,这些调用在调试应用程序时访问控件的 Handle 属性。Gets or sets a value indicating whether to catch calls on the wrong thread that access a control's Handle property when an application is being debugged. |
ClientRectangle |
获取表示控件的工作区的矩形。Gets the rectangle that represents the client area of the control. |
ClientSize |
获取或设置控件的工作区的高度和宽度。Gets or sets the height and width of the client area of the control. |
CompanyName |
获取包含控件的应用程序的公司名称或创建者。Gets the name of the company or creator of the application containing the control. |
Container |
获取包含 IContainer 的 Component。Gets the IContainer that contains the Component. (继承自 Component) |
ContainsFocus |
获取一个值,该值指示控件或它的一个子控件当前是否有输入焦点。Gets a value indicating whether the control, or one of its child controls, currently has the input focus. |
ContextMenu |
获取或设置与控件关联的快捷菜单。Gets or sets the shortcut menu associated with the control. |
ContextMenuStrip |
获取或设置与此控件关联的 ContextMenuStrip。Gets or sets the ContextMenuStrip associated with this control. |
Controls |
获取包含在控件内的控件的集合。Gets the collection of controls contained within the control. |
Created |
获取一个值,该值指示控件是否已经创建。Gets a value indicating whether the control has been created. |
CreateParams |
获取创建控件句柄时所需要的创建参数。Gets the required creation parameters when the control handle is created. |
Cursor |
获取或设置当鼠标指针位于控件上时显示的光标。Gets or sets the cursor that is displayed when the mouse pointer is over the control. |
DataBindings |
为该控件获取数据绑定。Gets the data bindings for the control. |
DefaultBackColor |
获取控件的默认背景色。Gets the default background color of the control. |
DefaultCursor |
获取或设置控件的默认光标。Gets or sets the default cursor for the control. |
DefaultFont |
获取控件的默认字体。Gets the default font of the control. |
DefaultForeColor |
获取控件的默认前景色。Gets the default foreground color of the control. |
DefaultImeMode |
获取控件支持的默认输入法编辑器 (IME) 模式。Gets the default Input Method Editor (IME) mode supported by the control. |
DefaultMargin |
获取控件之间默认指定的间距(以像素为单位)。Gets the space, in pixels, that is specified by default between controls. |
DefaultMaximumSize |
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最大大小。Gets the length and height, in pixels, that is specified as the default maximum size of a control. |
DefaultMinimumSize |
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最小大小。Gets the length and height, in pixels, that is specified as the default minimum size of a control. |
DefaultPadding |
获取控件内容的内部间距(以像素为单位)。Gets the internal spacing, in pixels, of the contents of a control. |
DefaultSize |
获取控件的默认大小。Gets the default size of the control. |
DesignMode |
获取一个值,用以指示 Component 当前是否处于设计模式。Gets a value that indicates whether the Component is currently in design mode. (继承自 Component) |
DeviceDpi |
获取显示当前控件的显示设备的 DPI 值。Gets the DPI value for the display device where the control is currently being displayed. |
DisplayRectangle |
获取表示控件的显示区域的矩形。Gets the rectangle that represents the display area of the control. |
Disposing |
获取一个值,该值指示 Control 基类是否在释放进程中。Gets a value indicating whether the base Control class is in the process of disposing. |
Dock |
获取或设置哪些控件边框停靠到其父控件并确定控件如何随其父级一起调整大小。Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. |
DoubleBuffered |
获取或设置一个值,该值指示此控件是否应使用辅助缓冲区重绘其图面,以减少或避免闪烁。Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. |
Enabled |
获取或设置一个值,该值指示控件是否可以对用户交互作出响应。Gets or sets a value indicating whether the control can respond to user interaction. |
Events |
获取附加到此 Component 的事件处理程序的列表。Gets the list of event handlers that are attached to this Component. (继承自 Component) |
Focused |
获取一个值,该值指示控件是否有输入焦点。Gets a value indicating whether the control has input focus. |
Font |
获取或设置控件显示的文字的字体。Gets or sets the font of the text displayed by the control. |
FontHeight |
获取或设置控件的字体的高度。Gets or sets the height of the font of the control. |
ForeColor |
获取或设置控件的前景色。Gets or sets the foreground color of the control. |
Handle |
获取控件绑定到的窗口句柄。Gets the window handle that the control is bound to. |
HasChildren |
获取一个值,该值指示控件是否包含一个或多个子控件。Gets a value indicating whether the control contains one or more child controls. |
Height |
获取或设置控件的高度。Gets or sets the height of the control. |
ImeMode |
获取或设置控件的输入法编辑器 (IME) 模式。Gets or sets the Input Method Editor (IME) mode of the control. |
ImeModeBase |
获取或设置控件的 IME 模式。Gets or sets the IME mode of a control. |
InvokeRequired |
获取一个值,该值指示调用方在对控件进行方法调用时是否必须调用 Invoke 方法,因为调用方位于创建控件所在的线程以外的线程中。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. |
IsAccessible |
获取或设置一个值,该值指示控件对辅助功能应用程序是否可见。Gets or sets a value indicating whether the control is visible to accessibility applications. |
IsDisposed |
获取一个值,该值指示控件是否已经被释放。Gets a value indicating whether the control has been disposed of. |
IsHandleCreated |
获取一个值,该值指示控件是否有与它关联的句柄。Gets a value indicating whether the control has a handle associated with it. |
IsMirrored |
获取一个值,该值指示此控件是否为镜像控件。Gets a value indicating whether the control is mirrored. |
LayoutEngine |
获取控件的布局引擎的缓存实例。Gets a cached instance of the control's layout engine. |
Left |
获取或设置控件左边缘与其容器的工作区左边缘之间的距离(以像素为单位)。Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. |
Location |
获取或设置该控件的左上角相对于其容器的左上角的坐标。Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. |
Margin |
获取或设置控件之间的空间。Gets or sets the space between controls. |
MaximumSize |
获取或设置大小,该大小是 GetPreferredSize(Size) 可以指定的上限。Gets or sets the size that is the upper limit that GetPreferredSize(Size) can specify. |
MinimumSize |
获取或设置大小,该大小是 GetPreferredSize(Size) 可以指定的下限。Gets or sets the size that is the lower limit that GetPreferredSize(Size) can specify. |
ModifierKeys |
获取一个表示哪个修改键(Shift、Ctrl 和 Alt)处于按下状态的值。Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state. |
MouseButtons |
获取一个指示哪个鼠标按钮处于按下状态的值。Gets a value indicating which of the mouse buttons is in a pressed state. |
MousePosition |
获取鼠标光标的位置(以屏幕坐标表示)。Gets the position of the mouse cursor in screen coordinates. |
Name |
获取或设置控件的名称。Gets or sets the name of the control. |
Padding |
获取或设置控件内的空白。Gets or sets padding within the control. |
Parent |
获取或设置控件的父容器。Gets or sets the parent container of the control. |
PreferredSize |
获取可以容纳控件的矩形区域的大小。Gets the size of a rectangular area into which the control can fit. |
ProductName |
获取包含控件的程序集的产品名称。Gets the product name of the assembly containing the control. |
ProductVersion |
获取包含控件的程序集的版本。Gets the version of the assembly containing the control. |
PropagatingImeMode |
获取一个表示传播 IME 模式的对象。Gets an object that represents a propagating IME mode. |
RecreatingHandle |
获取一个值,该值指示控件当前是否在重新创建其句柄。Gets a value indicating whether the control is currently re-creating its handle. |
Region |
获取或设置与控件关联的窗口区域。Gets or sets the window region associated with the control. |
RenderRightToLeft |
已过时。
此属性现已过时。This property is now obsolete. |
ResizeRedraw |
获取或设置一个值,该值指示控件在调整大小时是否重绘自己。Gets or sets a value indicating whether the control redraws itself when resized. |
Right |
获取控件右边缘与其容器的工作区左边缘之间的距离(以像素为单位)。Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. |
RightToLeft |
获取或设置一个值,该值指示是否将控件的元素对齐以支持使用从右向左的字体的区域设置。Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. |
ScaleChildren |
获取一个值,该值确定子控件的缩放。Gets a value that determines the scaling of child controls. |
ShowFocusCues |
获取一个值,该值指示控件是否应显示聚焦框。Gets a value indicating whether the control should display focus rectangles. |
ShowKeyboardCues |
获取一个值,该值指示用户界面是否处于适当的状态以显示或隐藏键盘快捷键。Gets a value indicating whether the user interface is in the appropriate state to show or hide keyboard accelerators. |
Site |
获取或设置控件的站点。Gets or sets the site of the control. |
Size |
获取或设置控件的高度和宽度。Gets or sets the height and width of the control. |
TabIndex |
获取或设置控件在其容器内的 Tab 键顺序。Gets or sets the tab order of the control within its container. |
TabStop |
获取或设置一个值,该值指示用户能否使用 Tab 键将焦点放到该控件上。Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. |
Tag |
获取或设置包含有关控件的数据的对象。Gets or sets the object that contains data about the control. |
Text |
获取或设置与此控件关联的文本。Gets or sets the text associated with this control. |
Top |
获取或设置控件上边缘与其容器的工作区上边缘之间的距离(以像素为单位)。Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. |
TopLevelControl |
获取没有另一个 Windows 窗体控件作为其父级的父控件。Gets the parent control that is not parented by another Windows Forms control. 通常,这是控件所在的最外面的 Form。Typically, this is the outermost Form that the control is contained in. |
UseWaitCursor |
获取或设置一个值,该值指示是否将等待光标用于当前控件以及所有子控件。Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. |
Visible |
获取或设置一个值,该值指示是否显示该控件及其所有子控件。Gets or sets a value indicating whether the control and all its child controls are displayed. |
Width |
获取或设置控件的宽度。Gets or sets the width of the control. |
WindowTarget |
此属性与此类无关。This property is not relevant for this class. |
方法
AccessibilityNotifyClients(AccessibleEvents, Int32) |
就指定子控件的指定 AccessibleEvents 通知辅助功能客户端应用程序。Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control. |
AccessibilityNotifyClients(AccessibleEvents, Int32, Int32) |
就指定子控件的指定 AccessibleEvents 通知辅助功能客户端应用程序。Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control . |
BeginInvoke(Delegate) |
在创建控件的基础句柄所在线程上异步执行指定委托。Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. |
BeginInvoke(Delegate, Object[]) |
在创建控件的基础句柄所在线程上,用指定的自变量异步执行指定委托。Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. |
BringToFront() |
将控件带到 Z 顺序的前面。Brings the control to the front of the z-order. |
Contains(Control) |
检索一个值,该值指示指定控件是否为一个控件的子控件。Retrieves a value indicating whether the specified control is a child of the control. |
CreateAccessibilityInstance() |
为该控件创建一个新的辅助功能对象。Creates a new accessibility object for the control. |
CreateControl() |
强制创建可见控件,包括创建句柄和任何可见子控件。Forces the creation of the visible control, including the creation of the handle and any visible child controls. |
CreateControlsInstance() |
为控件创建控件集合的新实例。Creates a new instance of the control collection for the control. |
CreateGraphics() | |
CreateHandle() |
为该控件创建句柄。Creates a handle for the control. |
CreateObjRef(Type) |
创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (继承自 MarshalByRefObject) |
DefWndProc(Message) |
向默认窗口过程发送指定消息。Sends the specified message to the default window procedure. |
DestroyHandle() |
毁坏与该控件关联的句柄。Destroys the handle associated with the control. |
Dispose() |
释放由 Component 使用的所有资源。Releases all resources used by the Component. (继承自 Component) |
Dispose(Boolean) |
释放由 Control 和它的子控件占用的非托管资源,另外还可以释放托管资源。Releases the unmanaged resources used by the Control and its child controls and optionally releases the managed resources. |
DoDragDrop(Object, DragDropEffects) |
开始拖放操作。Begins a drag-and-drop operation. |
DrawToBitmap(Bitmap, Rectangle) |
支持对指定位图的呈现。Supports rendering to the specified bitmap. |
EndInvoke(IAsyncResult) |
检索由传递的 IAsyncResult 表示的异步操作的返回值。Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. |
Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
FindForm() |
检索控件所在的窗体。Retrieves the form that the control is on. |
Focus() |
为控件设置输入焦点。Sets input focus to the control. |
FromChildHandle(IntPtr) |
检索包含指定句柄的控件。Retrieves the control that contains the specified handle. |
FromHandle(IntPtr) |
返回当前与指定句柄关联的控件。Returns the control that is currently associated with the specified handle. |
GetAccessibilityObjectById(Int32) |
检索指定的 AccessibleObject。Retrieves the specified AccessibleObject. |
GetAutoSizeMode() |
检索一个值,该值指示当启用控件的 AutoSize 属性时控件的行为方式。Retrieves a value indicating how a control will behave when its AutoSize property is enabled. |
GetChildAtPoint(Point) |
检索位于指定坐标处的子控件。Retrieves the child control that is located at the specified coordinates. |
GetChildAtPoint(Point, GetChildAtPointSkip) |
检索位于指定坐标的子控件,并且指定是否忽略特定类型的子控件。Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. |
GetContainerControl() |
沿着控件的父控件链向上,返回下一个 ContainerControl。Returns the next ContainerControl up the control's chain of parent controls. |
GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
GetLifetimeService() |
检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance. (继承自 MarshalByRefObject) |
GetNextControl(Control, Boolean) |
按照子控件的 Tab 键顺序向前或向后检索下一个控件。Retrieves the next control forward or back in the tab order of child controls. |
GetPreferredSize(Size) |
检索适合控件的矩形区域的大小。Retrieves the size of a rectangular area into which a control can be fitted. |
GetScaledBounds(Rectangle, SizeF, BoundsSpecified) |
检索缩放控件时的边界。Retrieves the bounds within which the control is scaled. |
GetService(Type) |
返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。Returns an object that represents a service provided by the Component or by its Container. (继承自 Component) |
GetStyle(ControlStyles) |
为控件检索指定控件样式位的值。Retrieves the value of the specified control style bit for the control. |
GetTopLevel() |
确定控件是否是顶级控件。Determines if the control is a top-level control. |
GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
Hide() |
对用户隐藏控件。Conceals the control from the user. |
InitializeLifetimeService() |
获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance. (继承自 MarshalByRefObject) |
InitLayout() |
在将控件添加到另一个容器之后调用。Called after the control has been added to another container. |
Invalidate() |
使控件的整个图面无效并导致重绘控件。Invalidates the entire surface of the control and causes the control to be redrawn. |
Invalidate(Boolean) |
使控件的特定区域无效并向控件发送绘制消息。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. |
Invalidate(Rectangle) |
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。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. |
Invalidate(Rectangle, Boolean) |
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。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. |
Invalidate(Region) |
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。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. |
Invalidate(Region, Boolean) |
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。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. |
Invoke(Delegate) |
在拥有此控件的基础窗口句柄的线程上执行指定的委托。Executes the specified delegate on the thread that owns the control's underlying window handle. |
Invoke(Delegate, Object[]) |
在拥有控件的基础窗口句柄的线程上,用指定的参数列表执行指定委托。Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. |
InvokeGotFocus(Control, EventArgs) |
为指定的控件引发 GotFocus 事件。Raises the GotFocus event for the specified control. |
InvokeLostFocus(Control, EventArgs) |
为指定的控件引发 LostFocus 事件。Raises the LostFocus event for the specified control. |
InvokeOnClick(Control, EventArgs) |
为指定的控件引发 Click 事件。Raises the Click event for the specified control. |
InvokePaint(Control, PaintEventArgs) |
为指定的控件引发 Paint 事件。Raises the Paint event for the specified control. |
InvokePaintBackground(Control, PaintEventArgs) |
为指定的控件引发 |
IsInputChar(Char) |
确定一个字符是否是控件可识别的输入字符。Determines if a character is an input character that the control recognizes. |
IsInputKey(Keys) |
确定指定的键是常规输入键还是需要预处理的特殊键。Determines whether the specified key is a regular input key or a special key that requires preprocessing. |
IsKeyLocked(Keys) |
确定 Caps Lock、Num Lock 或 Scroll Lock 键是否有效。Determines whether the CAPS LOCK, NUM LOCK, or SCROLL LOCK key is in effect. |
IsMnemonic(Char, String) |
搜索指定的字符串,以确定指定字符是否是分配给此控件的助记键字符。Determines if the specified character is the mnemonic character assigned to the control in the specified string. |
LogicalToDeviceUnits(Int32) |
将逻辑 DPI 值转换为它的等效 DeviceUnit DPI 值。Converts a Logical DPI value to its equivalent DeviceUnit DPI value. |
LogicalToDeviceUnits(Size) |
通过为当前 DPI 缩放小大并将其向下舍入为最接近的宽度和高度的整数值,将大小从逻辑单位转换为设备单位。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. |
MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
MemberwiseClone(Boolean) |
创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object. (继承自 MarshalByRefObject) |
NotifyInvalidate(Rectangle) |
引发 Invalidated 事件,其中带有要使之无效的控件的指定区域。Raises the Invalidated event with a specified region of the control to invalidate. |
OnAutoSizeChanged(EventArgs) |
引发 AutoSizeChanged 事件。Raises the AutoSizeChanged event. |
OnBackColorChanged(EventArgs) |
引发 BackColorChanged 事件。Raises the BackColorChanged event. |
OnBackgroundImageChanged(EventArgs) |
引发 BackgroundImageChanged 事件。Raises the BackgroundImageChanged event. |
OnBackgroundImageLayoutChanged(EventArgs) |
引发 BackgroundImageLayoutChanged 事件。Raises the BackgroundImageLayoutChanged event. |
OnBindingContextChanged(EventArgs) |
引发 BindingContextChanged 事件。Raises the BindingContextChanged event. |
OnCausesValidationChanged(EventArgs) |
引发 CausesValidationChanged 事件。Raises the CausesValidationChanged event. |
OnChangeUICues(UICuesEventArgs) |
引发 ChangeUICues 事件。Raises the ChangeUICues event. |
OnClick(EventArgs) | |
OnClientSizeChanged(EventArgs) |
引发 ClientSizeChanged 事件。Raises the ClientSizeChanged event. |
OnContextMenuChanged(EventArgs) |
引发 ContextMenuChanged 事件。Raises the ContextMenuChanged event. |
OnContextMenuStripChanged(EventArgs) |
引发 ContextMenuStripChanged 事件。Raises the ContextMenuStripChanged event. |
OnControlAdded(ControlEventArgs) |
引发 ControlAdded 事件。Raises the ControlAdded event. |
OnControlRemoved(ControlEventArgs) |
引发 ControlRemoved 事件。Raises the ControlRemoved event. |
OnCreateControl() |
引发 CreateControl() 方法。Raises the CreateControl() method. |
OnCursorChanged(EventArgs) |
引发 CursorChanged 事件。Raises the CursorChanged event. |
OnDockChanged(EventArgs) |
引发 DockChanged 事件。Raises the DockChanged event. |
OnDoubleClick(EventArgs) |
引发 DoubleClick 事件。Raises the DoubleClick event. |
OnDpiChangedAfterParent(EventArgs) |
引发 DpiChangedAfterParent 事件。Raises the DpiChangedAfterParent event. |
OnDpiChangedBeforeParent(EventArgs) |
引发 DpiChangedBeforeParent 事件。Raises the DpiChangedBeforeParent event. |
OnDragDrop(DragEventArgs) | |
OnDragEnter(DragEventArgs) | |
OnDragLeave(EventArgs) | |
OnDragOver(DragEventArgs) | |
OnEnabledChanged(EventArgs) |
引发 EnabledChanged 事件。Raises the EnabledChanged event. |
OnEnter(EventArgs) | |
OnFontChanged(EventArgs) |
引发 FontChanged 事件。Raises the FontChanged event. |
OnForeColorChanged(EventArgs) |
引发 ForeColorChanged 事件。Raises the ForeColorChanged event. |
OnGiveFeedback(GiveFeedbackEventArgs) |
引发 GiveFeedback 事件。Raises the GiveFeedback event. |
OnGotFocus(EventArgs) | |
OnHandleCreated(EventArgs) |
引发 HandleCreated 事件。Raises the HandleCreated event. |
OnHandleDestroyed(EventArgs) |
引发 HandleDestroyed 事件。Raises the HandleDestroyed event. |
OnHelpRequested(HelpEventArgs) |
引发 HelpRequested 事件。Raises the HelpRequested event. |
OnImeModeChanged(EventArgs) |
引发 ImeModeChanged 事件。Raises the ImeModeChanged event. |
OnInvalidated(InvalidateEventArgs) |
引发 Invalidated 事件。Raises the Invalidated event. |
OnKeyDown(KeyEventArgs) | |
OnKeyPress(KeyPressEventArgs) | |
OnKeyUp(KeyEventArgs) | |
OnLayout(LayoutEventArgs) | |
OnLeave(EventArgs) | |
OnLocationChanged(EventArgs) |
引发 LocationChanged 事件。Raises the LocationChanged event. |
OnLostFocus(EventArgs) | |
OnMarginChanged(EventArgs) |
引发 MarginChanged 事件。Raises the MarginChanged event. |
OnMouseCaptureChanged(EventArgs) |
引发 MouseCaptureChanged 事件。Raises the MouseCaptureChanged event. |
OnMouseClick(MouseEventArgs) |
引发 MouseClick 事件。Raises the MouseClick event. |
OnMouseDoubleClick(MouseEventArgs) |
引发 MouseDoubleClick 事件。Raises the MouseDoubleClick event. |
OnMouseDown(MouseEventArgs) | |
OnMouseEnter(EventArgs) |
引发 MouseEnter 事件。Raises the MouseEnter event. |
OnMouseHover(EventArgs) |
引发 MouseHover 事件。Raises the MouseHover event. |
OnMouseLeave(EventArgs) |
引发 MouseLeave 事件。Raises the MouseLeave event. |
OnMouseMove(MouseEventArgs) | |
OnMouseUp(MouseEventArgs) | |
OnMouseWheel(MouseEventArgs) |
引发 MouseWheel 事件。Raises the MouseWheel event. |
OnMove(EventArgs) | |
OnNotifyMessage(Message) |
向控件通知 Windows 消息。Notifies the control of Windows messages. |
OnPaddingChanged(EventArgs) |
引发 PaddingChanged 事件。Raises the PaddingChanged event. |
OnPaint(PaintEventArgs) | |
OnPaintBackground(PaintEventArgs) |
绘制控件的背景。Paints the background of the control. |
OnParentBackColorChanged(EventArgs) |
当控件容器的 BackColorChanged 属性值更改时,将引发 BackColor 事件。Raises the BackColorChanged event when the BackColor property value of the control's container changes. |
OnParentBackgroundImageChanged(EventArgs) |
当控件容器的 BackgroundImageChanged 属性值更改时,将引发 BackgroundImage 事件。Raises the BackgroundImageChanged event when the BackgroundImage property value of the control's container changes. |
OnParentBindingContextChanged(EventArgs) |
当控件容器的 BindingContextChanged 属性值更改时,将引发 BindingContext 事件。Raises the BindingContextChanged event when the BindingContext property value of the control's container changes. |
OnParentChanged(EventArgs) |
引发 ParentChanged 事件。Raises the ParentChanged event. |
OnParentCursorChanged(EventArgs) |
引发 CursorChanged 事件。Raises the CursorChanged event. |
OnParentEnabledChanged(EventArgs) |
当控件容器的 EnabledChanged 属性值更改时,将引发 Enabled 事件。Raises the EnabledChanged event when the Enabled property value of the control's container changes. |
OnParentFontChanged(EventArgs) |
当控件容器的 FontChanged 属性值更改时,将引发 Font 事件。Raises the FontChanged event when the Font property value of the control's container changes. |
OnParentForeColorChanged(EventArgs) |
当控件容器的 ForeColorChanged 属性值更改时,将引发 ForeColor 事件。Raises the ForeColorChanged event when the ForeColor property value of the control's container changes. |
OnParentRightToLeftChanged(EventArgs) |
当控件容器的 RightToLeftChanged 属性值更改时,将引发 RightToLeft 事件。Raises the RightToLeftChanged event when the RightToLeft property value of the control's container changes. |
OnParentVisibleChanged(EventArgs) |
当控件容器的 VisibleChanged 属性值更改时,将引发 Visible 事件。Raises the VisibleChanged event when the Visible property value of the control's container changes. |
OnPreviewKeyDown(PreviewKeyDownEventArgs) |
引发 PreviewKeyDown 事件。Raises the PreviewKeyDown event. |
OnPrint(PaintEventArgs) | |
OnQueryContinueDrag(QueryContinueDragEventArgs) |
引发 QueryContinueDrag 事件。Raises the QueryContinueDrag event. |
OnRegionChanged(EventArgs) |
引发 RegionChanged 事件。Raises the RegionChanged event. |
OnResize(EventArgs) | |
OnRightToLeftChanged(EventArgs) |
引发 RightToLeftChanged 事件。Raises the RightToLeftChanged event. |
OnSizeChanged(EventArgs) |
引发 SizeChanged 事件。Raises the SizeChanged event. |
OnStyleChanged(EventArgs) |
引发 StyleChanged 事件。Raises the StyleChanged event. |
OnSystemColorsChanged(EventArgs) |
引发 SystemColorsChanged 事件。Raises the SystemColorsChanged event. |
OnTabIndexChanged(EventArgs) |
引发 TabIndexChanged 事件。Raises the TabIndexChanged event. |
OnTabStopChanged(EventArgs) |
引发 TabStopChanged 事件。Raises the TabStopChanged event. |
OnTextChanged(EventArgs) |
引发 TextChanged 事件。Raises the TextChanged event. |
OnValidated(EventArgs) | |
OnValidating(CancelEventArgs) |
引发 Validating 事件。Raises the Validating event. |
OnVisibleChanged(EventArgs) |
引发 VisibleChanged 事件。Raises the VisibleChanged event. |
PerformLayout() |
强制控件将布局逻辑应用于其所有子控件。Forces the control to apply layout logic to all its child controls. |
PerformLayout(Control, String) |
强制控件将布局逻辑应用于其所有子控件。Forces the control to apply layout logic to all its child controls. |
PointToClient(Point) |
将指定屏幕点的位置计算成工作区坐标。Computes the location of the specified screen point into client coordinates. |
PointToScreen(Point) |
将指定工作区点的位置计算成屏幕坐标。Computes the location of the specified client point into screen coordinates. |
PreProcessControlMessage(Message) |
在调度键盘或输入消息之前,在消息循环内对它们进行预处理。Preprocesses keyboard or input messages within the message loop before they are dispatched. |
PreProcessMessage(Message) |
在调度键盘或输入消息之前,在消息循环内对它们进行预处理。Preprocesses keyboard or input messages within the message loop before they are dispatched. |
ProcessCmdKey(Message, Keys) |
处理命令键。Processes a command key. |
ProcessDialogChar(Char) |
处理对话框字符。Processes a dialog character. |
ProcessDialogKey(Keys) |
处理对话框键。Processes a dialog key. |
ProcessKeyEventArgs(Message) |
处理键消息并生成适当的控件事件。Processes a key message and generates the appropriate control events. |
ProcessKeyMessage(Message) |
处理键盘消息。Processes a keyboard message. |
ProcessKeyPreview(Message) |
预览键盘消息。Previews a keyboard message. |
ProcessMnemonic(Char) |
处理助记键字符。Processes a mnemonic character. |
RaiseDragEvent(Object, DragEventArgs) |
引发适当的拖动事件。Raises the appropriate drag event. |
RaiseKeyEvent(Object, KeyEventArgs) |
引发适当的键事件。Raises the appropriate key event. |
RaiseMouseEvent(Object, MouseEventArgs) |
引发适当的鼠标事件。Raises the appropriate mouse event. |
RaisePaintEvent(Object, PaintEventArgs) |
引发适当的绘画事件。Raises the appropriate paint event. |
RecreateHandle() |
强制为控件重新创建句柄。Forces the re-creation of the handle for the control. |
RectangleToClient(Rectangle) |
计算指定屏幕矩形的大小和位置(以工作区坐标表示)。Computes the size and location of the specified screen rectangle in client coordinates. |
RectangleToScreen(Rectangle) |
计算指定工作区矩形的大小和位置(以屏幕坐标表示)。Computes the size and location of the specified client rectangle in screen coordinates. |
ReflectMessage(IntPtr, Message) |
向绑定到指定句柄的控件反映指定消息。Reflects the specified message to the control that is bound to the specified handle. |
Refresh() |
强制控件使其工作区无效并立即重绘自己和任何子控件。Forces the control to invalidate its client area and immediately redraw itself and any child controls. |
RescaleConstantsForDpi(Int32, Int32) |
发生 DPI 更改时,提供用于重新缩放控件的常数。Provides constants for rescaling the control when a DPI change occurs. |
ResetBackColor() |
将 BackColor 属性重置为其默认值。Resets the BackColor property to its default value. |
ResetBindings() |
使绑定到 BindingSource 的控件重新读取列表中的所有项,并刷新这些项的显示值。Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. |
ResetCursor() |
将 Cursor 属性重置为其默认值。Resets the Cursor property to its default value. |
ResetFont() |
将 Font 属性重置为其默认值。Resets the Font property to its default value. |
ResetForeColor() |
将 ForeColor 属性重置为其默认值。Resets the ForeColor property to its default value. |
ResetImeMode() |
将 ImeMode 属性重置为其默认值。Resets the ImeMode property to its default value. |
ResetMouseEventArgs() |
重置控件以处理 MouseLeave 事件。Resets the control to handle the MouseLeave event. |
ResetRightToLeft() |
将 RightToLeft 属性重置为其默认值。Resets the RightToLeft property to its default value. |
ResetText() |
将 Text 属性重置为其默认值 (Empty)。Resets the Text property to its default value (Empty). |
ResumeLayout() |
恢复正常的布局逻辑。Resumes usual layout logic. |
ResumeLayout(Boolean) |
恢复正常的布局逻辑,可以选择强制对挂起的布局请求立即进行布局。Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. |
RtlTranslateAlignment(ContentAlignment) |
将指定的 ContentAlignment 转换为相应的 ContentAlignment 以支持从右向左的文本。Converts the specified ContentAlignment to the appropriate ContentAlignment to support right-to-left text. |
RtlTranslateAlignment(HorizontalAlignment) |
将指定的 HorizontalAlignment 转换为相应的 HorizontalAlignment 以支持从右向左的文本。Converts the specified HorizontalAlignment to the appropriate HorizontalAlignment to support right-to-left text. |
RtlTranslateAlignment(LeftRightAlignment) |
将指定的 LeftRightAlignment 转换为相应的 LeftRightAlignment 以支持从右向左的文本。Converts the specified LeftRightAlignment to the appropriate LeftRightAlignment to support right-to-left text. |
RtlTranslateContent(ContentAlignment) |
将指定的 ContentAlignment 转换为相应的 ContentAlignment 以支持从右向左的文本。Converts the specified ContentAlignment to the appropriate ContentAlignment to support right-to-left text. |
RtlTranslateHorizontal(HorizontalAlignment) |
将指定的 HorizontalAlignment 转换为相应的 HorizontalAlignment 以支持从右向左的文本。Converts the specified HorizontalAlignment to the appropriate HorizontalAlignment to support right-to-left text. |
RtlTranslateLeftRight(LeftRightAlignment) |
将指定的 LeftRightAlignment 转换为相应的 LeftRightAlignment 以支持从右向左的文本。Converts the specified LeftRightAlignment to the appropriate LeftRightAlignment to support right-to-left text. |
Scale(Single) |
已过时。
缩放控件和任何子控件。Scales the control and any child controls. |
Scale(Single, Single) |
已过时。
缩放整个控件和任何子控件。Scales the entire control and any child controls. |
Scale(SizeF) |
按指定的比例因子缩放控件和所有子控件。Scales the control and all child controls by the specified scaling factor. |
ScaleBitmapLogicalToDevice(Bitmap) |
发生 DPI 更改时,可以将逻辑位图值缩放到其等效设备单元值。Scales a logical bitmap value to it's equivalent device unit value when a DPI change occurs. |
ScaleControl(SizeF, BoundsSpecified) |
缩放控件的位置、大小、空白和边距。Scales a control's location, size, padding and margin. |
ScaleCore(Single, Single) |
此方法与此类无关。This method is not relevant for this class. |
Select() |
激活控件。Activates the control. |
Select(Boolean, Boolean) |
激活子控件。Activates a child control. 还可以指定从中选择控件的 Tab 键顺序的方向。Optionally specifies the direction in the tab order to select the control from. |
SelectNextControl(Control, Boolean, Boolean, Boolean, Boolean) |
激活下一个控件。Activates the next control. |
SendToBack() |
将控件发送到 Z 顺序的后面。Sends the control to the back of the z-order. |
SetAutoSizeMode(AutoSizeMode) |
设置一个值,该值指示当启用控件的 AutoSize 属性时控件的行为方式。Sets a value indicating how a control will behave when its AutoSize property is enabled. |
SetBounds(Int32, Int32, Int32, Int32) |
将控件的边界设置为指定位置和大小。Sets the bounds of the control to the specified location and size. |
SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) |
将控件的指定边界设置为指定位置和大小。Sets the specified bounds of the control to the specified location and size. |
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) |
执行设置该控件的指定边界的工作。Performs the work of setting the specified bounds of this control. |
SetClientSizeCore(Int32, Int32) |
设置控件的工作区的大小。Sets the size of the client area of the control. |
SetStyle(ControlStyles, Boolean) |
将指定的 ControlStyles 标志设置为 |
SetTopLevel(Boolean) |
将控件设置为顶级控件。Sets the control as the top-level control. |
SetVisibleCore(Boolean) |
将控件设置为指定的可见状态。Sets the control to the specified visible state. |
Show() |
向用户显示控件。Displays the control to the user. |
SizeFromClientSize(Size) |
确定整个控件(从控件工作区的高度和宽度起计算)的大小。Determines the size of the entire control from the height and width of its client area. |
SuspendLayout() |
临时挂起控件的布局逻辑。Temporarily suspends the layout logic for the control. |
ToString() |
返回包含 Component 的名称的 String(如果有)。Returns a String containing the name of the Component, if any. 不应重写此方法。This method should not be overridden. (继承自 Component) |
Update() |
使控件重绘其工作区内的无效区域。Causes the control to redraw the invalidated regions within its client area. |
UpdateBounds() |
用当前大小和位置更新控件的边界。Updates the bounds of the control with the current size and location. |
UpdateBounds(Int32, Int32, Int32, Int32) |
用指定大小和位置更新控件的边界。Updates the bounds of the control with the specified size and location. |
UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32) |
用指定大小、位置和工作区的大小更新控件的边界。Updates the bounds of the control with the specified size, location, and client size. |
UpdateStyles() |
强制将分配的样式重新应用到控件。Forces the assigned styles to be reapplied to the control. |
UpdateZOrder() |
按控件的父级的 Z 顺序更新控件。Updates the control in its parent's z-order. |
WndProc(Message) |
处理 Windows 消息。Processes Windows messages. |
事件
AutoSizeChanged |
此事件与此类无关。This event is not relevant for this class. |
BackColorChanged |
当 BackColor 属性的值更改时发生。Occurs when the value of the BackColor property changes. |
BackgroundImageChanged |
当 BackgroundImage 属性的值更改时发生。Occurs when the value of the BackgroundImage property changes. |
BackgroundImageLayoutChanged |
当 BackgroundImageLayout 属性更改时发生。Occurs when the BackgroundImageLayout property changes. |
BindingContextChanged |
当 BindingContext 属性的值更改时发生。Occurs when the value of the BindingContext property changes. |
CausesValidationChanged |
当 CausesValidation 属性的值更改时发生。Occurs when the value of the CausesValidation property changes. |
ChangeUICues |
焦点或键盘用户界面 (UI) 提示更改时发生。Occurs when the focus or keyboard user interface (UI) cues change. |
Click |
在单击控件时发生。Occurs when the control is clicked. |
ClientSizeChanged |
当 ClientSize 属性的值更改时发生。Occurs when the value of the ClientSize property changes. |
ContextMenuChanged |
当 ContextMenu 属性的值更改时发生。Occurs when the value of the ContextMenu property changes. |
ContextMenuStripChanged |
当 ContextMenuStrip 属性的值更改时发生。Occurs when the value of the ContextMenuStrip property changes. |
ControlAdded |
在将新控件添加到 Control.ControlCollection 时发生。Occurs when a new control is added to the Control.ControlCollection. |
ControlRemoved |
在从 Control.ControlCollection 移除控件时发生。Occurs when a control is removed from the Control.ControlCollection. |
CursorChanged |
当 Cursor 属性的值更改时发生。Occurs when the value of the Cursor property changes. |
Disposed |
在通过调用 Dispose() 方法释放组件时发生。Occurs when the component is disposed by a call to the Dispose() method. (继承自 Component) |
DockChanged |
当 Dock 属性的值更改时发生。Occurs when the value of the Dock property changes. |
DoubleClick |
在双击控件时发生。Occurs when the control is double-clicked. |
DpiChangedAfterParent |
当父控件或窗体的 DPI 更改后,以编程方式更改控件的 DPI 设置时发生。Occurs when the DPI setting for a control is changed programmatically after the DPI of its parent control or form has changed. |
DpiChangedBeforeParent |
父控件或窗体的 DPI 更改事件发生前,以编程方式更改控件的 DPI 设置时发生。Occurs when the DPI setting for a control is changed programmatically before a DPI change event for its parent control or form has occurred. |
DragDrop |
拖放操作完成时发生。Occurs when a drag-and-drop operation is completed. |
DragEnter |
在将对象拖入控件的边界时发生。Occurs when an object is dragged into the control's bounds. |
DragLeave |
将对象拖出控件的边界时发生。Occurs when an object is dragged out of the control's bounds. |
DragOver |
在将对象拖到控件的边界上发生。Occurs when an object is dragged over the control's bounds. |
EnabledChanged |
在 Enabled 属性值更改后发生。Occurs when the Enabled property value has changed. |
Enter |
进入控件时发生。Occurs when the control is entered. |
FontChanged |
在 Font 属性值更改时发生。Occurs when the Font property value changes. |
ForeColorChanged |
在 ForeColor 属性值更改时发生。Occurs when the ForeColor property value changes. |
GiveFeedback |
在执行拖动操作期间发生。Occurs during a drag operation. |
GotFocus |
在控件接收焦点时发生。Occurs when the control receives focus. |
HandleCreated |
在为控件创建句柄时发生。Occurs when a handle is created for the control. |
HandleDestroyed |
在控件的句柄处于销毁过程中时发生。Occurs when the control's handle is in the process of being destroyed. |
HelpRequested |
用户请求控件帮助时发生。Occurs when the user requests help for a control. |
ImeModeChanged |
在 ImeMode 属性更改后发生。Occurs when the ImeMode property has changed. |
Invalidated |
控件的显示要求重新绘制时发生。Occurs when a control's display requires redrawing. |
KeyDown |
在控件有焦点的情况下按下键时发生。Occurs when a key is pressed while the control has focus. |
KeyPress |
在控件有焦点的情况下Occurs when a character. 字符、空格或退格键时发生。space or backspace key is pressed while the control has focus. |
KeyUp |
在控件有焦点的情况下释放键时发生。Occurs when a key is released while the control has focus. |
Layout |
在控件应重新定位其子控件时发生。Occurs when a control should reposition its child controls. |
Leave |
在输入焦点离开控件时发生。Occurs when the input focus leaves the control. |
LocationChanged |
在 Location 属性值更改后发生。Occurs when the Location property value has changed. |
LostFocus |
在控件失去焦点时发生。Occurs when the control loses focus. |
MarginChanged |
在控件边距更改时发生。Occurs when the control's margin changes. |
MouseCaptureChanged |
当控件失去鼠标捕获时发生。Occurs when the control loses mouse capture. |
MouseClick |
用鼠标单击控件时发生。Occurs when the control is clicked by the mouse. |
MouseDoubleClick |
用鼠标双击控件时发生。Occurs when the control is double clicked by the mouse. |
MouseDown |
当鼠标指针位于控件上并按下鼠标键时发生。Occurs when the mouse pointer is over the control and a mouse button is pressed. |
MouseEnter |
在鼠标指针进入控件时发生。Occurs when the mouse pointer enters the control. |
MouseHover |
在鼠标指针停放在控件上时发生。Occurs when the mouse pointer rests on the control. |
MouseLeave |
在鼠标指针离开控件时发生。Occurs when the mouse pointer leaves the control. |
MouseMove |
在鼠标指针移到控件上时发生。Occurs when the mouse pointer is moved over the control. |
MouseUp |
在鼠标指针在控件上并释放鼠标键时发生。Occurs when the mouse pointer is over the control and a mouse button is released. |
MouseWheel |
在控件有焦点且鼠标轮移动时发生。Occurs when the mouse wheel moves while the control has focus. |
Move |
在移动控件时发生。Occurs when the control is moved. |
PaddingChanged |
在控件空白区更改时发生。Occurs when the control's padding changes. |
Paint |
在重绘控件时发生。Occurs when the control is redrawn. |
ParentChanged |
在 Parent 属性值更改时发生。Occurs when the Parent property value changes. |
PreviewKeyDown |
在焦点位于此控件上的情况下,当有按键动作时发生(在 KeyDown 事件之前发生)。Occurs before the KeyDown event when a key is pressed while focus is on this control. |
QueryAccessibilityHelp |
在 AccessibleObject 为辅助功能应用程序提供帮助时发生。Occurs when AccessibleObject is providing help to accessibility applications. |
QueryContinueDrag |
在拖放操作期间发生,并且允许拖动源确定是否应取消拖放操作。Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. |
RegionChanged |
当 Region 属性的值更改时发生。Occurs when the value of the Region property changes. |
Resize |
在调整控件大小时发生。Occurs when the control is resized. |
RightToLeftChanged |
在 RightToLeft 属性值更改时发生。Occurs when the RightToLeft property value changes. |
SizeChanged |
在 Size 属性值更改时发生。Occurs when the Size property value changes. |
StyleChanged |
在控件样式更改时发生。Occurs when the control style changes. |
SystemColorsChanged |
系统颜色更改时发生。Occurs when the system colors change. |
TabIndexChanged |
在 TabIndex 属性值更改时发生。Occurs when the TabIndex property value changes. |
TabStopChanged |
在 TabStop 属性值更改时发生。Occurs when the TabStop property value changes. |
TextChanged |
在 Text 属性值更改时发生。Occurs when the Text property value changes. |
Validated |
在控件完成验证时发生。Occurs when the control is finished validating. |
Validating |
在控件验证时发生。Occurs when the control is validating. |
VisibleChanged |
在 Visible 属性值更改时发生。Occurs when the Visible property value changes. |
显式接口实现
IDropTarget.OnDragDrop(DragEventArgs) | |
IDropTarget.OnDragEnter(DragEventArgs) | |
IDropTarget.OnDragLeave(EventArgs) | |
IDropTarget.OnDragOver(DragEventArgs) |
适用于
线程安全性
只有以下成员是线程安全的: BeginInvoke(Delegate) 、 EndInvoke(IAsyncResult) 、 Invoke(Delegate) 、 InvokeRequired 和( CreateGraphics() 如果已创建控件的句柄)。Only the following members are thread safe: BeginInvoke(Delegate), EndInvoke(IAsyncResult), Invoke(Delegate), InvokeRequired, and CreateGraphics() if the handle for the control has already been created. CreateGraphics()在后台线程上创建控件句柄之前调用可能导致非法的跨线程调用。Calling CreateGraphics() before the control's handle has been created on a background thread can cause illegal cross thread calls.