Border.cs
ToolStripContainer를 이용하여 JavaFx의 BorderPane과 유사한 기능을 구현 한다.
using System; using System.Drawing; using System.Windows.Forms; public class WBorder : WCtrl { ToolStripContainer border; public WBorder() { ctrl = border = new ToolStripContainer(); border.TopToolStripPanelVisible = false; border.RightToolStripPanelVisible = false; border.BottomToolStripPanelVisible = false; border.LeftToolStripPanelVisible = false; anchorAll(); dockFill(); } public void AddTop(Control ctl) { border.TopToolStripPanel.Controls.Add(ctl); border.TopToolStripPanelVisible = true; } public void AddRight(Control ctl) { border.RightToolStripPanel.Controls.Add(ctl); border.RightToolStripPanelVisible = true; } public void AddBottom(Control ctl) { border.BottomToolStripPanel.Controls.Add(ctl); border.BottomToolStripPanelVisible = true; } public void AddLeft(Control ctl) { border.LeftToolStripPanel.Controls.Add(ctl); border.LeftToolStripPanelVisible = true; } public void AddCenter(Control ctl) { border.ContentPanel.Controls.Add(ctl); border.ContentPanel.Padding = new Padding(10); } }
댓글 없음:
댓글 쓰기