CheckedListBox.CreateParams 속성

정의

컨트롤 핸들이 만들어지는 경우 필요한 작성 매개 변수를 가져옵니다.

protected:
 virtual property System::Windows::Forms::CreateParams ^ CreateParams { System::Windows::Forms::CreateParams ^ get(); };
protected override System.Windows.Forms.CreateParams CreateParams { get; }
member this.CreateParams : System.Windows.Forms.CreateParams
Protected Overrides ReadOnly Property CreateParams As CreateParams

속성 값

CreateParams

필요한 매개 변수가 포함된 CreateParams입니다.

예제

다음 코드 예제에서는 파생 클래스의 CreateParams Button 속성을 확장합니다. CreateParams.Style 속성이 변경되어 단추가 대신 Image표시됩니다Icon. 이 예제에서는 클래스에서 Button 상속되는 클래스가 있어야 합니다.

virtual System::Windows::Forms::CreateParams^ get() override
{
   
   // Extend the CreateParams property of the Button class.
   System::Windows::Forms::CreateParams^ cp = __super::CreateParams;

   // Update the button Style.
   cp->Style |= 0x00000040; // BS_ICON value
   return cp;
}
protected override CreateParams CreateParams
{
    get
    {
        // Extend the CreateParams property of the Button class.
        CreateParams cp = base.CreateParams;
        // Update the button Style.
        cp.Style |= 0x00000040; // BS_ICON value

        return cp;
    }
}

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
    Get
        Dim SecPerm As New SecurityPermission(SecurityPermissionFlag.UnmanagedCode)
        SecPerm.Demand()

        ' Extend the CreateParams property of the Button class.
        Dim cp As System.Windows.Forms.CreateParams = MyBase.CreateParams
        ' Update the button Style.
        cp.Style = cp.Style Or &H40 ' BS_ICON value

        Return cp
    End Get
End Property

설명

속성을 CreateParams 재정의하여 파생 컨트롤의 속성을 조정하는 데 사용하면 안 됩니다. 와 같은 속성은 컨트롤의 CreateParams.CaptionCreateParams.Width해당 속성(예: Control.TextControl.Width Control.Height및 )에 의해 설정되어야 합니다.CreateParams.Height CreateParams 표준 Windows 컨트롤 클래스를 래핑하거나 Windows Forms 네임스페이스에서 제공하지 않는 스타일을 설정하는 경우에만 확장해야 합니다. 제어 매개 변수를 만드는 방법에 대한 자세한 내용은 Windows 플랫폼 SDK 참조의 및 함수 및 CREATESTRUCT 구조 설명서를 참조 CreateWindow CreateWindowEx 하세요/.

상속자 참고

파생 클래스에서 CreateParams 속성을 재정의할 때 기본 클래스의 CreateParams 속성을 사용하여 기본 구현을 확장합니다. 그렇지 않으면 모든 구현을 제공해야 합니다.

적용 대상