示例#1
0
        private void ButtonWatch_Click(object sender, EventArgs e)
        {
            buttonWatch.Enabled = false;//2度押し防止
            if (labelWatchStatus.Text == "監視中")
            {
                if (cbw != null)
                {
                    cbw.Dispose();
                    cbw = null;
                }

                labelWatchStatus.Text = "監視停止中";
            }
            else
            {
                labelWatchStatus.Text = "監視中";
                cbw = new ClipBoardWatcher();
                cbw.DrawClipBoard += (sender2, e2) => {
                    if (Clipboard.ContainsImage())
                    {
                        buttonClip_Click(sender, null);
                        buttonSave_Click(sender, null);
                    }
                };
            }
            buttonWatch.Enabled = true;//2度押し防止
        }
示例#2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (cbw != null)
     {
         cbw.Dispose();
         cbw = null;
     }
 }
示例#3
0
 public Form1()
 {
     InitializeComponent();
     cbw = null;
 }