C#语言07-图形用户界面编程.pdf
• C#System.Windows.Forms.Form
– 1 C#
– 2
– 3
– 4 System.dll, System.Windows.Forms.dll,
System.Drawing.dll
– 5
Hello
using System;
using System.Windows.Forms;
using System.Drawing;
public class Hello
{
public static void Main()
{
Form t = new Form();
Application.Run(t); Form
}
t.Text = "Hello";
}
t.Size = new Size(300,200);
—— Form
• JFrame
–
Hello HelloWin
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
public class Hello public class Hello : Form
{ {
public static void Main() public Hello()
{ {
Form t = new Form(); Text = "Hello";
t.Text = "Hello"; Size = new Size(300,200);
t.Size = new Size(300,200); }
Application.Run(t); public static void Main()
} {
} Hello t = new Hello();
Application.Run(t);
}
}
• Form
Form
Object
public Form(); 300
public new Size Size {get; set;}
MarshalByRefObject public Rectangle Bounds {get; set;}
Component public FormStartPosition StartPosition {get; set;}