Bagikan melalui


ToolStrip.Items Properti

Definisi

Mendapatkan semua item milik ToolStrip.

public:
 virtual property System::Windows::Forms::ToolStripItemCollection ^ Items { System::Windows::Forms::ToolStripItemCollection ^ get(); };
public virtual System.Windows.Forms.ToolStripItemCollection Items { get; }
member this.Items : System.Windows.Forms.ToolStripItemCollection
Public Overridable ReadOnly Property Items As ToolStripItemCollection

Nilai Properti

Objek jenis ToolStripItemCollection, mewakili semua elemen yang dimuat oleh ToolStrip.

Contoh

Contoh kode berikut menambahkan kumpulan item ke ToolStrip.

this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] 
            {
            this.newToolStripButton,
            this.openToolStripButton,
            this.saveToolStripButton,
            this.printToolStripButton,
            this.toolStripSeparator,
            this.cutToolStripButton,
            this.copyToolStripButton,
            this.pasteToolStripButton,
            this.toolStripSeparator1,
            this.helpToolStripButton});
Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.newToolStripButton, Me.openToolStripButton, Me.saveToolStripButton, Me.printToolStripButton, Me.toolStripSeparator, Me.cutToolStripButton, Me.copyToolStripButton, Me.pasteToolStripButton, Me.toolStripSeparator1, Me.helpToolStripButton})

Keterangan

Items Gunakan koleksi untuk mengambil semua item yang telah ditambahkan ke ToolStrip, bukan hanya item yang ditampilkan. Item tetap berada Items dalam koleksi meskipun merupakan item luapan dan karenanya saat ini tidak terlihat.

DisplayedItems Gunakan properti untuk hanya mengambil item yang saat ini ditampilkan pada ToolStrip.

Berlaku untuk

Lihat juga