public OMETabStrip() { BeginInit(); SetStyle(ControlStyles.ContainerControl, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.Selectable, true); items = new OMETabStripItemCollection(); items.CollectionChanged += new CollectionChangeEventHandler(OnCollectionChanged); base.Size = new Size(350, 200); menu = new ContextMenuStrip(); menu.Renderer = ToolStripRenderer; menu.ItemClicked += new ToolStripItemClickedEventHandler(OnMenuItemClicked); menu.VisibleChanged += new EventHandler(OnMenuVisibleChanged); menuGlyph = new OMETabStripMenuGlyph(ToolStripRenderer); closeButton = new OMETabStripCloseButton(ToolStripRenderer); Font = defaultFont; sf = new StringFormat(); EndInit(); UpdateLayout(); }
public virtual void Assign(OMETabStripItemCollection collection) { BeginUpdate(); try { Clear(); for (int n = 0; n < collection.Count; n++) { OMETabStripItem item = collection[n]; OMETabStripItem newItem = new OMETabStripItem(); newItem.Assign(item); Add(newItem); } } finally { EndUpdate(); } }