zoukankan      html  css  js  c++  java
  • 写写

    WPF使用多线程访问控件及打开新窗口:

    private void button1_Click(object sender, RoutedEventArgs e)
            {
                Thread thread = new Thread(new ParameterizedThreadStart(AppendData));
                thread.SetApartmentState(ApartmentState.STA);//由新线程去开启新窗口时需要设置
                thread.IsBackground = true;
                thread.Start("ABC");
            }

            delegate void AppendText(string message);
            void AppendData(object msge)
            {
                Dispatcher.BeginInvoke(new AppendText(app), new object[] { msge.ToString() });//访问控件
                Th t = new Th();
                t.Show();
                System.Windows.Threading.Dispatcher.Run();//开启新窗口后要是没有加上这句,打开的窗口会很快被关闭掉

               
            }

          //控件赋值
            void app(string msg)
            {
                txtbox.Text = msg;
            }

    WPF实现与winform的timer控件功能

    使用

    DispatcherTimer 类

    DispatcherTimer timer = null;
            public MainWindow()
            {
                InitializeComponent();
                timer = new DispatcherTimer();
                timer.Tick += new EventHandler(timer_Tick);
                timer.Interval = TimeSpan.FromSeconds(1);
                timer.Start();
            }

            private void button1_Click(object sender, RoutedEventArgs e)
            {
                timer.Stop();//停止
            }

  • 相关阅读:
    目标检测应用化之web页面(YOLO、SSD等)
    传统候选区域提取方法
    非极大值抑制(Non-Maximum Suppression,NMS)
    Darknet windows移植(YOLO v2)
    线性判别分析 LDA
    SVM 支持向量机
    特征-相似度衡量
    布隆过滤器 Bloom Filter
    聚类算法
    图论--最大流
  • 原文地址:https://www.cnblogs.com/KimhillZhang/p/2689752.html
Copyright © 2011-2022 走看看