Dock Top and Bottom : Dock : GUI Windows Forms C# Examples


C# Examples » GUI Windows Forms » Dock »

 

Dock Top and Bottom








    
using  System;
using  System.Drawing;
using  System.Windows.Forms;

public  class  ControlDock  :  Form
{
    public  ControlDock()
    {
        Size  =  new  Size(350,400);

        int  yButtonSize  =  Font.Height  *  2;

        Button  btn  =  new  Button();
        btn.Parent  =  this;
        btn.Text  =  "First  Button";
        btn.Height  =  yButtonSize;
        btn.Dock  =  DockStyle.Top;

        btn  =  new  Button();
        btn.Parent  =  this;
        btn.Text  =  "Second  Button";
        btn.Height  =  yButtonSize;
        btn.Dock  =  DockStyle.Bottom;
    }

    static  void  Main()  
    {
        Application.Run(new  ControlDock());
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo GUI Windows Forms
» Dock