spacer
Yehuda Shiran August 30, 2002
Initializing the Windows Form
Tips: August 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

A Windows form is defined by a class. This class includes the initialization of all form controls, such as panels, buttons, and text boxes. This class should include a function by the same name, which is the class constructor. Here is a definition of such a class (PanelForm):

  class PanelForm extends System.Windows.Forms.Form {   
    private var label1: Label;
    private var textBox1: TextBox;
    private var button1: Button;
    private var panel1: Panel;
		
    function PanelForm() {                         
          .
          .
          .
          .
          .
    }
  } 
The constructor function, PanelForm(), first sets three properties of the form (Text, ClientSize, and StartPosition):

  this.Text= "Anchoring Demo: Resize Me"; 
  this.ClientSize= new System.Drawing.Size(300,350);
  this.StartPosition= System.Windows.Forms.FormStartPosition.CenterScreen;
The code above sets the text of the window (at the top bar), its size (300x350), and its position (CenterScreen).

To learn more about JScript .NET and ASP.NET, go to Column 117, JScript .NET, Part XI: Creating Windows Forms.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint