Advertisement
Guest User

Picbox del

a guest
Apr 30th, 2010
1,430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  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 Form1 : Form
  13.     {
  14.         bool sel = false;
  15.  
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void pictureBox1_Click(object sender, EventArgs e)
  22.         {
  23.             if (sel == true)
  24.             {
  25.                 pictureBox1.BorderStyle = BorderStyle.None;
  26.                 sel = false;
  27.             }
  28.             else
  29.             {
  30.                 pictureBox1.BorderStyle = BorderStyle.FixedSingle;
  31.                 sel = true;
  32.             }
  33.         }
  34.  
  35.         private void Form1_KeyDown(object sender, KeyEventArgs e)
  36.         {
  37.             if (sel)
  38.             {
  39.                 pictureBox1.Visible = false;
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement