Breaking News
Loading...
Monday 22 July 2013

How to resize form In C#.Net

            For Resizing of form programmatically using c#.net is very easy. Here we give some code which is use to resize the form .by using this code you can make animation like application in c#.net also.


Here in my application user can enter size (width and height) of the form and on click event of the button he resize the form as per its requirements
For resizing form when form is in maximize state it not possible so firs we have to set state of form to be normal then we apply the. height and width properties to the form.

private void button1_Click(object sender, EventArgs e)
{
            if (this.WindowState==FormWindowState.Maximized)
            {
                this.WindowState = FormWindowState.Normal;
            }
            if (textBox1.Text!="" && textBox2.Text!="" )
            {
                this.Width = Convert.ToInt16(textBox1.Text.Trim());
                this.Height = Convert.ToInt16(textBox2.Text.Trim());
            }
  }

 Download Application


3 comments:

  1. SAP Ireland

    The Smart Office provides IT services to SMEs in the form of Business Intelligence (SAP Business One), Business Analysis, E-Commerce, IT Consultancy and informational Web Design. For more information then visit - Website: www.thesmartoffice.ie

    ReplyDelete
  2. Here, you can read great Beginner and Advance C# Programming tutorials...

    C# Programming Tutorials

    ReplyDelete

Thanks for comment

 
Toggle Footer