• 大小: 167KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: C#
  • 标签: 单击  双击事件  winform  C#  

资源简介

C# winform 单击与双击事件同时存在例子 在wiform中单击与双击事件是不可以同时存在的。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace WindowsFormsApplication13
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            skinEngine1.SkinFile = Application.StartupPath + @“/Silver.ssk“;
        }
        int count = 0;
        bool isC = true;
        Thread t;

        private void textBox1_MouseDown(object sender MouseEventArgs e)
        {

            isC = true;
            if ((Environment.TickCount - count) < 500)
            {
                Thread tt = new Thread(new ParameterizedThreadStart((o) =>
                {
                    isC = false;
                    MessageBox.Show(“Ddddd“);
                }));
                tt.Name = “wolf1“;
                tt.IsBackground = true;
                tt.Priority = ThreadPriority.Highest;
                tt.Start();

                t.Abort();

            }
            t = new Thread(new ParameterizedThreadStart((o) =>
           {
               Thread.Sleep(1000);
               if (Convert.ToBoolean(o))
               {
                   MessageBox.Show(o.ToString());
               }
           }));
            t.Name = “wolf“;
            t.IsBackground = true;
            t.Start(isC);
        }

        private void SetText(string s)
        {
            this.textBox1.Text = s;
        }
        private void textBox1_MouseUp(object sender MouseEventArgs e)
        {
            count = Environment.TickCount;
            //if (e.Clicks == 2)
            //{
            //    MessageBox.Show(“2222222222“);
            //}

            //   Thread.Sleep(1000);
            //   MessageBox.Show(“Test“);


        }


    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1406  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Properties\AssemblyInfo.cs

     文件       5612  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Properties\Resources.resx

     文件       2900  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Properties\Resources.Designer.cs

     文件        249  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Properties\Settings.settings

     文件       1110  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Properties\Settings.Designer.cs

     文件       1950  2012-09-26 21:25  WindowsFormsApplication13\WindowsFormsApplication13\Form1.cs

     文件       4123  2012-09-26 20:06  WindowsFormsApplication13\WindowsFormsApplication13\Form1.Designer.cs

     文件        506  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\Program.cs

     文件       3825  2012-09-20 15:24  WindowsFormsApplication13\WindowsFormsApplication13\WindowsFormsApplication13.csproj

     文件        490  2010-03-17 22:39  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\WindowsFormsApplication13.vshost.exe.manifest

     文件      11608  2012-09-26 21:16  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\WindowsFormsApplication13.vshost.exe

     文件      14795  2008-07-26 11:12  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\Silver.ssk

     文件     516096  2008-07-26 09:25  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\IrisSkin2.dll

     文件      10240  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\WindowsFormsApplication13.exe

     文件      22016  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug\WindowsFormsApplication13.pdb

     文件       6381  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       5862  2012-09-20 15:22  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件        180  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\WindowsFormsApplication13.Form1.resources

     文件        180  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\WindowsFormsApplication13.Properties.Resources.resources

     文件        594  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\GenerateResource-ResGen.read.1.tlog

     文件       1042  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\GenerateResource-ResGen.write.1.tlog

     文件      22016  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\WindowsFormsApplication13.pdb

     文件      10240  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\WindowsFormsApplication13.exe

     文件       1435  2012-09-26 21:29  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\WindowsFormsApplication13.csproj.FileListAbsolute.txt

     文件       6016  2012-09-26 20:06  WindowsFormsApplication13\WindowsFormsApplication13\Form1.resx

     文件        917  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13.sln

    ..A..H.     19456  2012-09-26 20:34  WindowsFormsApplication13\WindowsFormsApplication13.suo

     目录          0  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug\TempPE

     目录          0  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\obj\x86\Debug

     目录          0  2012-09-20 15:21  WindowsFormsApplication13\WindowsFormsApplication13\bin\Debug

............此处省略9个文件信息

评论

共有 条评论