ICreate.Controls.Bars Send comments on this topic.
Items Property
See Also  Example
ICreate.Controls.Bars Namespace > SideBar Class : Items Property






Gets or sets the collection of SideBarItems displayed on the SideBar.

Syntax

Visual Basic (Declaration) 
Public Property Items As BarItemCollection(Of SideBarItem)
Visual Basic (Usage)Copy Code
Dim instance As SideBar
Dim value As BarItemCollection(Of SideBarItem)
 
instance.Items = value
 
value = instance.Items
C# 
public BarItemCollection<SideBarItem> Items {get; set;}
Delphi 
public read-write property Items: BarItemCollection; 
JScript 
public function get,set Items : BarItemCollection
Managed Extensions for C++ 
public: __property BarItemCollection<SideBarItem>* get_Items();
public: __property void set_Items( 
   BarItemCollection<SideBarItem>* value
);
C++/CLI 
public:
property BarItemCollection<SideBarItem>^ Items {
   BarItemCollection<SideBarItem>^ get();
   void set (BarItemCollection<SideBarItem>^ value);
}

Return Value

A reference to a BarItemCollection, this property stores the collection of SideBarItem components owned by and displayed on the SideBar. The default value is a collection with no SideBarItem components.

Example

The example below shows how to add SideBarItem components to a SideBar using the Items property.
C#Copy Code
using System; 
using System.Windows.Forms; 
using ICreate.Controls.Bars; 
 
namespace ExamplesSideBarCSharp 

    public partial class ItemsPropertyExample : Form 
    { 
        public ItemsPropertyExample() 
        { 
            InitializeComponent(); 
 
            SideBar sideBar = new SideBar(); 
            sideBar.Dock = DockStyle.Left; 
 
            sideBar.Items.Add(new SideBarItem("Mail", null)); 
            sideBar.Items.Add(new SideBarItem("Contacts", null)); 
            sideBar.Items.Add(new SideBarItem("Tasks", null)); 
            sideBar.Items.Add(new SideBarItem("Notes", null)); 
 
            Controls.Add(sideBar); 
        } 
    } 
}
Visual BasicCopy Code
Imports ICreate.Controls.Bars

Public Class ItemsPropertyExample

    Public Sub New()

        InitializeComponent()
        Dim SideBar As SideBar = New SideBar()
        SideBar.Dock = DockStyle.Left

        SideBar.Items.Add(New SideBarItem("Mail", Nothing))
        SideBar.Items.Add(New SideBarItem("Contacts", Nothing))
        SideBar.Items.Add(New SideBarItem("Tasks", Nothing))
        SideBar.Items.Add(New SideBarItem("Notes", Nothing))

        Controls.Add(SideBar)

    End Sub
End Class

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also