using System;
using System.Drawing;
using System.Windows.Forms;
public class ButtonBackColor : Form
{
Button btn;
public ButtonBackColor()
{
Text = "Button Properties";
Size = new Size(300,200);
btn = new Button();
btn.Parent = this;
btn.Text = "text";
btn.Location = new Point(10,10);
btn.BackColor = Color.LightGreen;
f(btn);
}
static void Main()
{
Application.Run(new ButtonBackColor());
}
private void f(Button btn)
{
int xSize = 100;
int ySize = 100;
btn.Size = new Size(xSize, ySize);
}
}
|