Freigeben über


CheckedListBox.ThreeDCheckBoxes-Eigenschaft

Ruft einen Wert ab, der angibt, ob die Kontrollkästchen einen System.Windows.Forms.ButtonState mit dem Wert Flat oder Normal aufweisen, oder legt diesen fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Property ThreeDCheckBoxes As Boolean
'Usage
Dim instance As CheckedListBox
Dim value As Boolean

value = instance.ThreeDCheckBoxes

instance.ThreeDCheckBoxes = value
public bool ThreeDCheckBoxes { get; set; }
public:
property bool ThreeDCheckBoxes {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_ThreeDCheckBoxes ()

/** @property */
public void set_ThreeDCheckBoxes (boolean value)
public function get ThreeDCheckBoxes () : boolean

public function set ThreeDCheckBoxes (value : boolean)

Eigenschaftenwert

true, wenn das Kontrollkästchen flach dargestellt wird, andernfalls false. Der Standardwert ist true.

Beispiel

Im folgenden Codebeispiel wird das Initialisieren eines CheckedListBox-Steuerelements durch Festlegen der CheckOnClick-Eigenschaft, der SelectionMode-Eigenschaft und der ThreeDCheckBoxes-Eigenschaft veranschaulicht. Im Beispiel wird die CheckedListBox mit Steuerelementen aufgefüllt und DisplayMember auf die Control.Name-Eigenschaft des Steuerelements festgelegt.

Zum Ausführen des Beispiels fügen Sie folgenden Code in ein Formular ein, das eine CheckedListBox mit dem Namen CheckedListBox1 enthält, und rufen Sie die InitializeCheckListBox-Methode im Konstruktor oder in der Load-Methode des Formulars auf.

// This method initializes CheckedListBox1 with a list of all 
// the controls on the form. It sets the selection mode
// to single selection and allows selection with a single click.
// It adds itself to the list before adding itself to the form.

internal System.Windows.Forms.CheckedListBox CheckedListBox1;

private void InitializeCheckedListBox()
{
    this.CheckedListBox1 = new CheckedListBox();
    this.CheckedListBox1.Location = new System.Drawing.Point(40, 90);
    this.CheckedListBox1.CheckOnClick = true;
    this.CheckedListBox1.Name = "CheckedListBox1";
    this.CheckedListBox1.Size = new System.Drawing.Size(120, 94);
    this.CheckedListBox1.TabIndex = 1;
    this.CheckedListBox1.SelectionMode = SelectionMode.One;
    this.CheckedListBox1.ThreeDCheckBoxes = true;

    foreach ( Control aControl in this.Controls )
    {
        this.CheckedListBox1.Items.Add(aControl, false);
    }

    this.CheckedListBox1.DisplayMember = "Name";
    this.CheckedListBox1.Items.Add(CheckedListBox1);
    this.Controls.Add(this.CheckedListBox1);
}
   // This method initializes CheckedListBox1 with a list of all 
   // the controls on the form. It sets the selection mode
   // to single selection and allows selection with a single click.
   // It adds itself to the list before adding itself to the form.
internal:
   System::Windows::Forms::CheckedListBox^ CheckedListBox1;

private:
   void InitializeCheckedListBox()
   {
      this->CheckedListBox1 = gcnew CheckedListBox;
      this->CheckedListBox1->Location = System::Drawing::Point( 40, 90 );
      this->CheckedListBox1->CheckOnClick = true;
      this->CheckedListBox1->Name = "CheckedListBox1";
      this->CheckedListBox1->Size = System::Drawing::Size( 120, 94 );
      this->CheckedListBox1->TabIndex = 1;
      this->CheckedListBox1->SelectionMode = SelectionMode::One;
      this->CheckedListBox1->ThreeDCheckBoxes = true;
      System::Collections::IEnumerator^ myEnum = this->Controls->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         Control^ aControl = safe_cast<Control^>(myEnum->Current);
         this->CheckedListBox1->Items->Add( aControl, false );
      }

      this->CheckedListBox1->DisplayMember = "Name";
      this->CheckedListBox1->Items->Add( CheckedListBox1 );
      this->Controls->Add( this->CheckedListBox1 );
   }

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

CheckedListBox-Klasse
CheckedListBox-Member
System.Windows.Forms-Namespace
ButtonState-Enumeration