Académique Documents
Professionnel Documents
Culture Documents
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;
this.Controls.Add(b);
}
Pen Yellow = new Pen(Color.Yellow);
Pen Blue = new Pen(Color.Blue);
Pen Red = new Pen(Color.Red);
System.Drawing.SolidBrush FillYellow = new System.Drawing.SolidBrush(Color.Yellow);
System.Drawing.SolidBrush FillBlue = new System.Drawing.SolidBrush(Color.Blue);
System.Drawing.SolidBrush FillRed = new System.Drawing.SolidBrush(Color.Red);
g.DrawRectangle(Yellow, rect1);
g.DrawRectangle(Blue, rect2);
g.DrawRectangle(Red, rect3);
g.FillRectangle(FillYellow, rect1);
g.FillRectangle(FillBlue, rect2);
g.FillRectangle(FillRed, rect3);
}
if (e.KeyCode == Keys.Up)
{
this.Top -= 50;
}
}
}
Form2---------------------------------------------------------------------------------------------
using System.Data.SqlClient;
namespace WindowsFormsApp12
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
Button b = new Button();
b.Location = new Point(15, 110);
b.Name = "Button1";
b.Text = "Salvează";
b.Size = new Size(70, 30);
b.Font = new Font("Minion Pro", 9);
b.Padding = new Padding(0);
b.Click += new EventHandler(this.Button_click);
this.Controls.Add(b);