Guest User

Untitled

a guest
May 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. private void setup(object sender, PaintEventArgs e) {
  2. int x = 50;
  3. int y = 50;
  4. int w = 15;
  5. int h = w;
  6. Color color = Color.FromArgb(255, 255, 255);
  7.  
  8. Point location = new Point(x, y);
  9. Size size = new Size(w, h);
  10.  
  11. Task t = Task.Run(()=> {
  12.  
  13. Rectangle Rect = new Rectangle(location, size);
  14.  
  15. e.Graphics.DrawRectangle(new Pen(color), Rect);
  16. e.Graphics.FillRectangle(new SolidBrush(color), Rect);
  17.  
  18. Thread.Sleep(5000);
  19.  
  20. });
  21. }
Add Comment
Please, Sign In to add comment