Want more features on Pastebin? Sign Up, it's FREE!
Guest

Picbox del

By: a guest on Apr 30th, 2010  |  syntax: C#  |  size: 0.95 KB  |  views: 675  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data