public void AddItem(System.Drawing.Design.ToolboxItem Item, int TabIndex, ToolBoxItemDetails details, string imagePath, string toolTip) { if (TabIndex > arrTabs.Count - 1 && TabIndex < 0) { MessageBox.Show("Invalid Index value given to AddItem"); return; } ToolBoxTab tab = GetTab(TabIndex); tab.AddItem(Item); tab.ImgListView.Items.Add(imagePath, toolTip, details.Caption); tab.ImgListView.Items[0].Selected = true; tab.ImgListView.BringToFront(); }
public void AddTab(ToolBoxTab Tab) { Tab.ImgListView.Dock = DockStyle.Fill; this.Controls.Add(Tab.ImgListView); int nr = arrTabs.Count; Tab.ImgListView.ItemClick += ImgListView_ItemClick; if (ClientRectangle.Height <= (nr + 5) * (ButtonHeight) + YOffset) { MessageBox.Show("You cannot add more tabs because it will fill up the list space"); return; } //ListView lv = Tab.ListV ; //lv.Columns.Add(Tab.Caption,ButtonWidth-20,HorizontalAlignment.Left); //lv.FullRowSelect = true; //lv.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; //lv.LabelEdit = true; //lv.MultiSelect = false; //lv.View = System.Windows.Forms.View.Details; //if(VisibleLV!=null) arrTabs.Add(Tab); //SetVisibleLV(lv); }
//private ListView VisibleLV = new ListView(); public void AddTab(string Caption, int ImgIndex, ImageList ImgList) { ToolBoxTab tab = new ToolBoxTab(); AddTab(tab); }