public void addTab(JPanelTab tab) { int index = nextIndex(); int t = getNextTabY(index, tab.getTab().NormalImage().Height); if (index == 0) { tabPage.Size = new Size(tab.getTab().NormalImage().Width, Height); } var pic = new JImageTab { BackColor = Color.Transparent, Image = tab.getTab().NormalImage(), NormalImage = tab.getTab().NormalImage(), EnterImage = tab.getTab().EnterImage(), PressedImage = tab.getTab().PressedImage(), ActiveImage = tab.getTab().ActiveImage(), Size = tab.getTab().NormalImage().Size }; pic.BackColor = Color.Transparent; pic.Location = new Point(tabPage.Location.X, t); tabPage.Controls.Add(pic); tab.initialize(pic, this); _pages.Add(index, tab); }
public void initialize(JImageTab tab, JTabbedPane pane) { _tab = tab; _parent = pane; _imageWidth = tab.Width; tab.MouseClick += tab_MouseClick; Location = new Point(tab.Width - tab.Location.X, pane.Location.Y); Size = new Size(_parent.Size.Width - tab.Width, _parent.Height); }