Reader Level:
ARTICLE

Windows Forms Without VS .NET

Posted by Sankar Ramanathan Articles | Windows Forms C# September 12, 2001
This article explains how to write windows forms application without using Visual Studio .NET IDE.
  • 0
  • 0
  • 8054

Simple Window Form Creation - No need to have VS.Net, just Notepad with .NetFramework in ur system will do. Just a starter... This program shows different ways to write Windows Forms like instead of Conrols.AddRange u can use Contol.Add and continue with it.

Just used of Drawing and Form Dlls.

The Windows.Forms namespace contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows operating system. In this namespace you will find the Form class and many other controls that can be added to forms to create user interfaces.

The System.Drawing namespace provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces.

The Graphics class provides methods for drawing to the display device. Classes such as Rectangle and Point encapsulate GDI+ primitives. The Pen class is used to draw lines and curves, while classes derrived from the abstract class Brush are used to fill the interiors of shapes.

Compilation - CSC /r:system.drawing.dll /r:system.windows.forms.dll filename.cs

For [ Beta 2]

using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
Label label1 =
new Label();
TextBox textBox1 =
new TextBox();
Button button1 =
new Button();
Label label2 =
new Label();
public Form1()
{
label1.Location =
new Point(56, 48);
label1.Name = "label1";
label1.TabIndex = 0;
label1.Text = "Enter Ur Name : ";
textBox1.Location =
new Point(176, 48);
textBox1.Name = "textBox1";
textBox1.Size =
new Size(112, 20);
textBox1.Text = "";
button1.Location =
new Point(128, 104);
button1.Name = "button1";
button1.Text = "Click Me";
label2.Location =
new Point(88, 192);
label2.Name = "label2";
button1.Click +=
new System.EventHandler(button1_Click1a);
//Controls.AddRange(new Control[]
//{label2, button1, textBox1, label1});
//Instead of this u can use the Following
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(button1);
Controls.Add(textBox1);
}
static void Main()
{
Application.Run(
new Form1());
}
private void button1_Click1a(object sender, System.EventArgs e)
{
label2.Text = "Thanks a Lot ";
}
}

COMMENT USING

Trending up