One Panel with Splitter : Splitter « GUI Windows Form « C# / C Sharp






One Panel with Splitter

 


using System;
using System.Drawing;
using System.Windows.Forms;
   
class OnePanelWithSplitter: Form
{
     public static void Main()
     {
          Application.Run(new OnePanelWithSplitter());
     }
     public OnePanelWithSplitter()
     {
          Text = "One Panel with Splitter";
   
          Splitter split  = new Splitter();
          split.Parent    = this;
          split.Dock      = DockStyle.Left;
   
          Panel panel     = new Panel();
          panel.Parent    = this;
          panel.Dock      = DockStyle.Left;
          panel.BackColor = Color.Lime;
          panel.Resize   += new EventHandler(PanelOnResize);
          panel.Paint    += new PaintEventHandler(PanelOnPaint);
     }
     void PanelOnResize(object obj, EventArgs ea)
     {
          ((Panel) obj).Invalidate();
     }
     void PanelOnPaint(object obj, PaintEventArgs pea)
     {
          Panel    panel = (Panel) obj;
          Graphics grfx  = pea.Graphics;
   
          grfx.DrawEllipse(Pens.Black, 0, 0, 
                           panel.Width - 1, panel.Height - 1);
     }
}

 








Related examples in the same category

1.HTML Split WindowHTML Split Window
2.Split Two Proportional
3.Split Three Frames
4.Split Three Across
5.Two Panels with Splitter