Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12.     public partial class Form4 : Form
  13.     {
  14.         public Form4()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             Graphics forDraw;
  22.             forDraw = panel1.CreateGraphics();
  23.             Pen p1 = new Pen(Color.Aqua, 9);
  24.             Brush b1 = Brushes.Black;
  25.             forDraw.DrawRectangle(p1, 100, 100, 500, 500);
  26.             forDraw.FillRectangle(b1, 100, 100, 500, 500);
  27.         }          
  28.        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement