Control.CreateHandle Control.CreateHandle Control.CreateHandle Control.CreateHandle Method

定义

为该控件创建句柄。Creates a handle for the control.

protected:
 virtual void CreateHandle();
protected virtual void CreateHandle ();
abstract member CreateHandle : unit -> unit
override this.CreateHandle : unit -> unit
Protected Overridable Sub CreateHandle ()

异常

对象处于释放状态。The object is in a disposed state.

注解

通常不应调用CreateHandle直接方法。You typically should not call the CreateHandle method directly. 首选的方法是调用CreateControl方法,这会强制创建控件时要创建的控件及其子控件的句柄。The preferred method is to call the CreateControl method, which forces a handle to be created for the control and its child controls when the control is created.

继承者说明

重写时CreateHandle()在派生类中,请务必调用基类的CreateHandle()方法,以确保已创建了句柄。When overriding CreateHandle() in a derived class, be sure to call the base class's CreateHandle() method to ensure that the handle is created.

安全性

UIPermission
有关继承的类来调用此方法的所有窗口。for all windows for inheriting classes to call this method. 关联枚举:AllWindows的值UIPermissionWindowAssociated enumeration: AllWindows value of UIPermissionWindow.

适用于

另请参阅