代码改变世界

单双击问题

2013-09-23 12:39  inguiq  阅读(154)  评论(0)    收藏  举报

 int click = 1;
        private void timer_Sigle_Tick(object sender, EventArgs e)
        {
            click = click + 1;
            if (click == 5)
            {
                Operate_Click(sender, e);
                timer_Sigle.Enabled = false;
                click = 1;
            }
        }
        private void Operate_Click(object sender, EventArgs e)
        {
            //PictureBox pic = sender as PictureBox;
            foreach (PictureBox pi in fpnlShow.Controls)
            {
                pi.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            }
            ////    Point mx = MousePosition;
            ////    Point mx2 = pic.PointToClient(mx);
            ////    if (e.X >= mx2.X - fpnlShow.Location.X && e.X <= mx2.X + pic.Width - fpnlShow.Location.X
            ////&& e.Y >= mx2.Y && e.Y <= mx2.Y + pic.Height)
            pic.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        }
        PictureBox pic;
        private void picUp_MouseClick(object sender, MouseEventArgs e)
        {
            timer_Sigle.Enabled = true;
            timer_Sigle.Interval = 50;
            pic = sender as PictureBox;
            //foreach (PictureBox pi in fpnlShow.Controls)
            //{
            //    pi.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            //}
            //////    Point mx = MousePosition;
            //////    Point mx2 = pic.PointToClient(mx);
            //////    if (e.X >= mx2.X - fpnlShow.Location.X && e.X <= mx2.X + pic.Width - fpnlShow.Location.X
            //////&& e.Y >= mx2.Y && e.Y <= mx2.Y + pic.Height)
            //pic.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            _hint.Visible = false;
            vScrollBar1.Focus();
        }

        /// <summary>
        /// 双击播放视频
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void picUp_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            timer_Sigle.Enabled = false;
            //Operate_DoubleClick(sender, e);
            PictureBox pic = sender as PictureBox;