zoukankan      html  css  js  c++  java
  • winform小记

    FormBorderStyle:None让边框消失

    private int time = 5;//停止五秒 //计时器 private void timer1_Tick(object sender, EventArgs e) { if (time!=0) { time; } else { this.timer1.Stop(); UserThisFunction(); } } 让程序停止几秒,我是这样做的。如果用线程的sleep方法的话,UI会不出来

    System.Environment.Exit(0); winform关闭程序

    RegistryKey keyroot = Registry.ClassesRoot;
                string flashkey = @"CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}";
                RegistryKey rkFlash = keyroot.OpenSubKey(flashkey);
                if (rkFlash == null)
                {
                    //System.Diagnostics.Process.Start(Application.StartupPath + "\\flash10.exe");
    
                    DialogResult dialog = MessageBox.Show("检测到您的电脑没有安装flash player,现在是否去官方下载所需插件?", "检测提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (dialog == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start("http://get.adobe.com/cn/flashplayer/");
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
                else
                {
                    frmMain f = new frmMain();
                    this.Hide();
                    Application.DoEvents();//中间加这句
                    f.ShowDialog();
                }

    winform检测是否安装了flash

     RegistryKey keyroot = Registry.ClassesRoot;
                string flashkey = @"CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}";
                RegistryKey rkFlash = keyroot.OpenSubKey(flashkey);
                if (rkFlash == null)
                {
                    System.Diagnostics.Process.Start(Application.StartupPath + "\\flash10.exe");
                }

    flash player安装文件放在bin目录下

  • 相关阅读:
    在人生路上对我影响最大的三位老师
    秋季学期学习总结
    转载非原创 Windows编程革命简史
    转载 关于12360系统的讨论
    SQLServer 触发器
    sqlserver 自定义函数
    jQuery 动画
    jQuery让页面生动起来(操作页面里面的元素)
    jQuery选择元素
    SqlServer_Case_When用法
  • 原文地址:https://www.cnblogs.com/hougelou/p/2854471.html
Copyright © 2011-2022 走看看