Defining the Border Style of the Form

I l @ ve RuBoard

The previous examples are both simple, fixed- size forms that have no minimize or restore button. The border style of the form object controls how a form is shown and if it can be resized.

Listing 3.1.4 shows a very simple Windows Forms application with a sizable client area.

Listing 3.1.4 resize.cs : A Simple Resizable Windows Forms Application
 using System; using System.Drawing; using System.ComponentModel; using System.WinForms; public class SizeApp : System.WinForms.Form {     public     SizeApp()     {         this.Text = "SizeApp";         this.MaximizeBox = true;         this.BorderStyle = FormBorderStyle.Sizable;     }     static void Main()     {         Application.Run(new SizeApp());     } } 

Building and running this application will result in a resizable application that can also be minimized to the taskbar and restored in the normal way.

I l @ ve RuBoard


C# and the .NET Framework. The C++ Perspective
C# and the .NET Framework
ISBN: 067232153X
EAN: 2147483647
Year: 2001
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net