123456789101112131415161718192021222324252627282930 |
- 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 WindowsFormsGDIDrawRectangle
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- Graphics graphics = this.CreateGraphics();
-
- Pen myPen = new Pen(Color.Black, 8);
-
- graphics.DrawRectangle(myPen, 10, 10, 150, 100);
- }
- }
- }
|