August 30, 2002 - Initializing the Windows Form
August 30, 2002 Initializing the Windows Form Tips: August 2002
Yehuda Shiran, Ph.D.
|
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.