Aracılığıyla paylaş


StatusBar.StatusBarPanelCollection Sınıf

Tanım

Dikkat

StatusBar is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use StatusStrip instead.

Denetimdeki panel StatusBar koleksiyonunu temsil eder.

public: ref class StatusBar::StatusBarPanelCollection : System::Collections::IList
public class StatusBar.StatusBarPanelCollection : System.Collections.IList
[System.ComponentModel.ListBindable(false)]
public class StatusBar.StatusBarPanelCollection : System.Collections.IList
[System.ComponentModel.ListBindable(false)]
[System.ComponentModel.Browsable(false)]
[System.Obsolete("`StatusBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `StatusStrip` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public class StatusBar.StatusBarPanelCollection : System.Collections.IList
type StatusBar.StatusBarPanelCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.ComponentModel.ListBindable(false)>]
type StatusBar.StatusBarPanelCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.ComponentModel.ListBindable(false)>]
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("`StatusBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `StatusStrip` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")>]
type StatusBar.StatusBarPanelCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class StatusBar.StatusBarPanelCollection
Implements IList
Devralma
StatusBar.StatusBarPanelCollection
Öznitelikler
Uygulamalar

Örnekler

Aşağıdaki kod örneği, formda bir StatusBar denetim oluşturur ve iki StatusBarPanel nesne ekler. adlı panel1öğesinden StatusBarPanelbiri, bir uygulamanın durum metnini görüntüler. adlı panel2ikinci StatusBarPanel, geçerli tarihi görüntüler ve geçerli saati görüntülemek için sınıfın özelliğini StatusBarPanel kullanırToolTipText. Örnek, standart panel yerine panellerin görüntülendiğinden emin olmak için Add özelliğini kullanır ShowPanels ve ve özelliğini kullanarak panelleri StatusBaröğesine eklemek için yöntemini StatusBar.StatusBarPanelCollection kullanırPanels. Örnek ayrıca, nesneleri başlatmak StatusBarPanel için , BorderStyle, ToolTipTextve Text özelliklerini kullanırAutoSize. Bu örnekte tanımlanan yönteminin bir Formoluşturucusundan tanımlandığı ve çağrıldığı varsayılır.

private:
   void CreateMyStatusBar()
   {
      // Create a StatusBar control.
      StatusBar^ statusBar1 = gcnew StatusBar;

      // Create two StatusBarPanel objects to display in the StatusBar.
      StatusBarPanel^ panel1 = gcnew StatusBarPanel;
      StatusBarPanel^ panel2 = gcnew StatusBarPanel;

      // Display the first panel with a sunken border style.
      panel1->BorderStyle = StatusBarPanelBorderStyle::Sunken;

      // Initialize the text of the panel.
      panel1->Text = "Ready...";

      // Set the AutoSize property to use all remaining space on the StatusBar.
      panel1->AutoSize = StatusBarPanelAutoSize::Spring;

      // Display the second panel with a raised border style.
      panel2->BorderStyle = StatusBarPanelBorderStyle::Raised;

      // Create ToolTip text that displays the time the application
      // was started.
      panel2->ToolTipText = System::DateTime::Now.ToShortTimeString();

      // Set the text of the panel to the current date.
      panel2->Text = "Started: " + System::DateTime::Today.ToLongDateString();

      // Set the AutoSize property to size the panel to the size of the contents.
      panel2->AutoSize = StatusBarPanelAutoSize::Contents;

      // Display panels in the StatusBar control.
      statusBar1->ShowPanels = true;

      // Add both panels to the StatusBarPanelCollection of the StatusBar.   
      statusBar1->Panels->Add( panel1 );
      statusBar1->Panels->Add( panel2 );

      // Add the StatusBar to the form.
      this->Controls->Add( statusBar1 );
   }
private void CreateMyStatusBar()
{
    // Create a StatusBar control.
    StatusBar statusBar1 = new StatusBar();
    // Create two StatusBarPanel objects to display in the StatusBar.
    StatusBarPanel panel1 = new StatusBarPanel();
    StatusBarPanel panel2 = new StatusBarPanel();

    // Display the first panel with a sunken border style.
    panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken;
    // Initialize the text of the panel.
    panel1.Text = "Ready...";
    // Set the AutoSize property to use all remaining space on the StatusBar.
    panel1.AutoSize = StatusBarPanelAutoSize.Spring;
    
    // Display the second panel with a raised border style.
    panel2.BorderStyle = StatusBarPanelBorderStyle.Raised;
    
    // Create ToolTip text that displays time the application was started.
    panel2.ToolTipText = "Started: " + System.DateTime.Now.ToShortTimeString();
    // Set the text of the panel to the current date.
    panel2.Text = System.DateTime.Today.ToLongDateString();
    // Set the AutoSize property to size the panel to the size of the contents.
    panel2.AutoSize = StatusBarPanelAutoSize.Contents;
                
    // Display panels in the StatusBar control.
    statusBar1.ShowPanels = true;

    // Add both panels to the StatusBarPanelCollection of the StatusBar.			
    statusBar1.Panels.Add(panel1);
    statusBar1.Panels.Add(panel2);

    // Add the StatusBar to the form.
    this.Controls.Add(statusBar1);
}
Private Sub CreateMyStatusBar()
   ' Create a StatusBar control.
   Dim statusBar1 As New StatusBar()

   ' Create two StatusBarPanel objects to display in the StatusBar.
   Dim panel1 As New StatusBarPanel()
   Dim panel2 As New StatusBarPanel()

   ' Display the first panel with a sunken border style.
   panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken

   ' Initialize the text of the panel.
   panel1.Text = "Ready..."

   ' Set the AutoSize property to use all remaining space on the StatusBar.
   panel1.AutoSize = StatusBarPanelAutoSize.Spring
   
   ' Display the second panel with a raised border style.
   panel2.BorderStyle = StatusBarPanelBorderStyle.Raised
   
   ' Create ToolTip text that displays the time the application was started.
   panel2.ToolTipText = "Started: " & System.DateTime.Now.ToShortTimeString()

   ' Set the text of the panel to the current date.
   panel2.Text = System.DateTime.Today.ToLongDateString()

   ' Set the AutoSize property to size the panel to the size of the contents.
   panel2.AutoSize = StatusBarPanelAutoSize.Contents

   ' Display panels in the StatusBar control.
   statusBar1.ShowPanels = True

   ' Add both panels to the StatusBarPanelCollection of the StatusBar.			
   statusBar1.Panels.Add(panel1)
   statusBar1.Panels.Add(panel2)

   ' Add the StatusBar to the form.
   Me.Controls.Add(statusBar1)
End Sub

Açıklamalar

StatusBar.StatusBarPanelCollection sınıfı içinde StatusBargörüntülenen panelleri depolar. Koleksiyondaki her nesne, içinde görüntülenen panelin görüntü özelliklerini ve davranışlarını tanımlayan sınıfının bir StatusBarörneğidirStatusBarPanel.

Koleksiyona panel eklemenin çeşitli yolları vardır. yöntemi, Add koleksiyona tek bir panel ekleme olanağı sağlar. Koleksiyona bir dizi panel eklemek için bir nesne dizisi StatusBarPanel oluşturur ve bunu yöntemine AddRange atarsınız. Koleksiyonun içinde belirli bir konuma panel eklemek istiyorsanız yöntemini kullanabilirsiniz Insert . Panelleri kaldırmak için, panelin Remove koleksiyon içinde nerede bulunduğunu biliyorsanız yöntemini veya RemoveAt yöntemini kullanabilirsiniz. yöntemi, Clear tek seferde tek bir paneli kaldırmak için yöntemini kullanmak Remove yerine koleksiyondaki tüm panelleri kaldırmanızı sağlar.

Panel ekleme ve kaldırma yöntemlerine ve özelliklerine ek olarak, StatusBar.StatusBarPanelCollection koleksiyon içindeki panelleri bulmak için yöntemler de sağlar. yöntemi, Contains bir panelin koleksiyonun üyesi olup olmadığını belirlemenizi sağlar. Panelin koleksiyon içinde yer aldığını bildiğinizde, panelin IndexOf koleksiyon içinde nerede bulunduğunu belirlemek için yöntemini kullanabilirsiniz.

Oluşturucular

Name Description
StatusBar.StatusBarPanelCollection(StatusBar)
Geçersiz.

StatusBar.StatusBarPanelCollection sınıfının yeni bir örneğini başlatır.

Özellikler

Name Description
Count
Geçersiz.

Koleksiyondaki öğe sayısını alır.

IsReadOnly
Geçersiz.

Bu koleksiyonun salt okunur olup olmadığını belirten bir değer alır.

Item[Int32]
Geçersiz.

Belirtilen dizinde öğesini StatusBarPanel alır veya ayarlar.

Item[String]
Geçersiz.

Koleksiyondan belirtilen anahtara sahip bir öğe alır.

Yöntemler

Name Description
Add(StatusBarPanel)
Geçersiz.

Koleksiyona bir StatusBarPanel ekler.

Add(String)
Geçersiz.

StatusBarPanel Belirtilen metinle bir değerini koleksiyona ekler.

AddRange(StatusBarPanel[])
Geçersiz.

Koleksiyona bir nesne dizisi StatusBarPanel ekler.

Clear()
Geçersiz.

Koleksiyondaki tüm öğeleri kaldırır.

Contains(StatusBarPanel)
Geçersiz.

Belirtilen panelin koleksiyon içinde bulunup bulunmadığını belirler.

ContainsKey(String)
Geçersiz.

Koleksiyonun belirtilen anahtarla birlikte bir StatusBarPanel içerip içermediğini belirler.

Equals(Object)
Geçersiz.

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetEnumerator()
Geçersiz.

Öğe koleksiyonunda yinelemek için kullanılacak bir numaralandırıcı döndürür.

GetHashCode()
Geçersiz.

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()
Geçersiz.

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
IndexOf(StatusBarPanel)
Geçersiz.

Belirtilen panelin koleksiyonundaki dizini döndürür.

IndexOfKey(String)
Geçersiz.

Belirtilen anahtara sahip bir StatusBarPanel öğesinin ilk oluşumunun dizinini döndürür.

Insert(Int32, StatusBarPanel)
Geçersiz.

Belirtilen StatusBarPanel dizinindeki koleksiyona belirtilen öğesini ekler.

MemberwiseClone()
Geçersiz.

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
Remove(StatusBarPanel)
Geçersiz.

Belirtilen StatusBarPanel öğesini koleksiyondan kaldırır.

RemoveAt(Int32)
Geçersiz.

StatusBarPanel Koleksiyon içinde belirtilen dizinde bulunan öğesini kaldırır.

RemoveByKey(String)
Geçersiz.

StatusBarPanel belirtilen anahtarla öğesini koleksiyondan kaldırır.

ToString()
Geçersiz.

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

Name Description
ICollection.CopyTo(Array, Int32)
Geçersiz.

StatusBar.StatusBarPanelCollection hedef dizinin belirtilen dizininden başlayarak öğesini uyumlu bir tek boyutlu diziye kopyalar.

ICollection.IsSynchronized
Geçersiz.

Koleksiyona erişimin eşitlenip eşitlenmediğini belirten bir değer alır (iş parçacığı güvenli).

ICollection.SyncRoot
Geçersiz.

Koleksiyona erişimi eşitlemek için kullanılabilecek bir nesne alır.

IList.Add(Object)

Bu API, ürün altyapısını destekler ve doğrudan kodunuzdan kullanıma yönelik değildir.

Geçersiz.

Koleksiyona bir StatusBarPanel ekler.

IList.Contains(Object)
Geçersiz.

Belirtilen panelin koleksiyon içinde bulunup bulunmadığını belirler.

IList.IndexOf(Object)
Geçersiz.

Koleksiyon içinde belirtilen panelin dizinini döndürür.

IList.Insert(Int32, Object)
Geçersiz.

Belirtilen StatusBarPanel dizinindeki koleksiyona belirtilen öğesini ekler.

IList.IsFixedSize
Geçersiz.

Koleksiyonun sabit bir boyutu olup olmadığını belirten bir değer alır.

IList.Item[Int32]
Geçersiz.

Belirtilen dizinde öğesini alır veya ayarlar.

IList.Remove(Object)
Geçersiz.

Belirtilen StatusBarPanel öğesini koleksiyondan kaldırır.

Uzantı Metotları

Name Description
AsParallel(IEnumerable)
Geçersiz.

Sorgunun paralelleştirilmesini etkinleştirir.

AsQueryable(IEnumerable)
Geçersiz.

bir IEnumerableIQueryabledönüştürür.

Cast<TResult>(IEnumerable)
Geçersiz.

Bir IEnumerable öğelerini belirtilen türe yayınlar.

OfType<TResult>(IEnumerable)
Geçersiz.

Bir IEnumerable öğelerini belirtilen türe göre filtreler.

Şunlara uygulanır

Ayrıca bkz.