1. SplitContainer Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | using System; using System.Windows.Forms; using System.Drawing; namespace WindowsFormsApp3 { class CsSplitContainer { SplitContainer split; public CsSplitContainer() { split = new SplitContainer(); split.Orientation = Orientation.Vertical; split.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left; split.Dock = DockStyle.Fill; split.AutoScaleMode = AutoScaleMode.Inherit; //split.Size = new Size(100,200); split.SplitterDistance = 200; split.SplitterWidth = 6; split.Location = new Point(0, 0); split.FixedPanel = FixedPanel.Panel1; split.Panel1MinSize = 100; split.Panel1MinSize = 100; split.Panel1Collapsed = false; split.Show(); } public SplitContainer get() { return split; } public void addLeftPanel(Control control) { SplitterPanel panel = split.Panel1; //panel.BackColor = Color.Green; //panel.ForeColor = Color.Yellow; panel.Controls.Add(control); } public void addRightPanel(Control control) { SplitterPanel panel = split.Panel2; //panel.BackColor = Color.OrangeRed; //panel.ForeColor = Color.White; panel.Controls.Add(control); } } } |
댓글 없음:
댓글 쓰기