主题:想用此控件。该放哪儿呢。老错。
void IntializeOutlookBar()
{
outlookBar1= new OutlookBar();
listView1= new ListViewEx();
treeView1= new TreeViewEx();
InitializeListControl();
InitializeTreeControl();
OutlookBarBand outlookShortcutsBand = new OutlookBarBand("Outlook Shortcuts");
outlookShortcutsBand.SmallImageList = outlookSmallIcons;
outlookShortcutsBand.LargeImageList = outlookLargeIcons;
outlookShortcutsBand.Item.Add(new OutlookBarItem("Outlook Today",0));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Inbox",1));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Calendar",2));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Contacts",3));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Tasks",4));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Notes",5));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Deleted Items",6));
outlookBar1.Bands.Add(outlookShortcutsBand);
OutlookBarBand myShorcutsBand = new OutlookBarBand("My Shorcuts");
myShorcutsBand.SmallImageList = myShortcutsSmallIcons;
myShorcutsBand.LargeImageList = myShortcutsLargeIcons;
myShorcutsBand.Item.Add(new OutlookBarItem("Contacts",0));
myShorcutsBand.Item.Add(new OutlookBarItem("Music",1));
myShorcutsBand.Item.Add(new OutlookBarItem("Defragment",2));
myShorcutsBand.Item.Add(new OutlookBarItem("Games",3));
myShorcutsBand.Item.Add(new OutlookBarItem("Security",4));
myShorcutsBand.Item.Add(new OutlookBarItem("Users",5));
myShorcutsBand.Item.Add(new OutlookBarItem("Fonts",6));
myShorcutsBand.Item.Add(new OutlookBarItem("Speaker",7));
myShorcutsBand.Item.Add(new OutlookBarItem("Picture",8));
myShorcutsBand.Background = SystemColors.AppWorkspace;
myShorcutsBand.TextColor = Color.White;
outlookBar1.Bands.Add(myShorcutsBand);
outlookBar1.Bands.Add(new OutlookBarBand("TreeView",treeView1));
outlookBar1.Bands.Add(new OutlookBarBand("ListView",listView1));
outlookBar1.Dock = DockStyle.Fill;
outlookBar1.SetCurrentBand(1);
outlookBar1.ItemClicked += new OutlookBarItemClickedHandler( OnOutlookBarItemClicked);
this.Controls.AddRange(new Control[]{outlookBar1});
}
{
outlookBar1= new OutlookBar();
listView1= new ListViewEx();
treeView1= new TreeViewEx();
InitializeListControl();
InitializeTreeControl();
OutlookBarBand outlookShortcutsBand = new OutlookBarBand("Outlook Shortcuts");
outlookShortcutsBand.SmallImageList = outlookSmallIcons;
outlookShortcutsBand.LargeImageList = outlookLargeIcons;
outlookShortcutsBand.Item.Add(new OutlookBarItem("Outlook Today",0));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Inbox",1));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Calendar",2));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Contacts",3));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Tasks",4));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Notes",5));
outlookShortcutsBand.Item.Add(new OutlookBarItem("Deleted Items",6));
outlookBar1.Bands.Add(outlookShortcutsBand);
OutlookBarBand myShorcutsBand = new OutlookBarBand("My Shorcuts");
myShorcutsBand.SmallImageList = myShortcutsSmallIcons;
myShorcutsBand.LargeImageList = myShortcutsLargeIcons;
myShorcutsBand.Item.Add(new OutlookBarItem("Contacts",0));
myShorcutsBand.Item.Add(new OutlookBarItem("Music",1));
myShorcutsBand.Item.Add(new OutlookBarItem("Defragment",2));
myShorcutsBand.Item.Add(new OutlookBarItem("Games",3));
myShorcutsBand.Item.Add(new OutlookBarItem("Security",4));
myShorcutsBand.Item.Add(new OutlookBarItem("Users",5));
myShorcutsBand.Item.Add(new OutlookBarItem("Fonts",6));
myShorcutsBand.Item.Add(new OutlookBarItem("Speaker",7));
myShorcutsBand.Item.Add(new OutlookBarItem("Picture",8));
myShorcutsBand.Background = SystemColors.AppWorkspace;
myShorcutsBand.TextColor = Color.White;
outlookBar1.Bands.Add(myShorcutsBand);
outlookBar1.Bands.Add(new OutlookBarBand("TreeView",treeView1));
outlookBar1.Bands.Add(new OutlookBarBand("ListView",listView1));
outlookBar1.Dock = DockStyle.Fill;
outlookBar1.SetCurrentBand(1);
outlookBar1.ItemClicked += new OutlookBarItemClickedHandler( OnOutlookBarItemClicked);
this.Controls.AddRange(new Control[]{outlookBar1});
}