using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp39
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Pen myPen = new Pen(Color.Black, 2);
Graphics formgraphics = null;
formgraphics = this.CreateGraphics();
SolidBrush drawBrush = new SolidBrush(Color.Black);
Brush fillBrush = Brushes.Gray;
formgraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
formgraphics.FillRectangle(fillBrush, new Rectangle(10, 10, 250, 80));
formgraphics.DrawRectangle(myPen, new Rectangle(10, 10, 250, 80));
myPen.Dispose();
formgraphics.Dispose();
}
}
}