Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Book Cover C# and the .NET Framework
63029 times
Rated
Read 63,029 times

Contents

Related Categories

Introduction to Windows Forms - Defining the Border Style

Defining the Border Style

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.

Comments

  • Re: [1770] Introduction to Windows Forms

    Posted by Dracorat on 13 Aug 2008

    Actually all you have to do in place an ampersand before the letter you want underlined.

    So if you want the "r" in "Print" underlined, enter in the code:

    "P&rint"

    That's ...

  • short-cuts

    Posted by rholden on 15 Jul 2005

    this is not a programming issue and it is not something you can set unless you have a custom menu control.

    if you want to view the _ all the time for alt shortcuts you have to go to:

    display pro...

  • Sort-cuts

    Posted by DotDot on 15 May 2003

    The "_" on the short-cut character is visible only when "ALT" is pressed. Is it possible to display the "_" programatically???:confused: