zoukankan
html css js c++ java
C#(.net) 线程和最小化到托盘的例子
自己写的一个使用线程和最小化到托盘的例子。
例子下载
当你看这个例子你就知道线程的强大了,:-)
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
using
System.Threading;
using
System.Diagnostics;
namespace
thread
{
public
partial
class
Form1 : Form
{
Thread t1;
public
Form1()
{
InitializeComponent();
this
.notifyIcon1.Visible
=
false
;
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls
=
false
;
}
private
void
button1_Click(
object
sender, EventArgs e)
{
t1
=
new
Thread(
new
ThreadStart(BackGroudProcess));
t1.Start();
}
private
void
BackGroudProcess()
{
int
i
=
1
;
while
(
true
)
{
listBox1.Items.Add(
"
Iterations:
"
+
i.ToString());
i
++
;
}
}
private
void
button2_Click(
object
sender, EventArgs e)
{
t1.Abort();
}
private
void
button3_Click(
object
sender, EventArgs e)
{
int
i
=
1
;
while
(
true
)
{
listBox1.Items.Add(
"
Iterations:
"
+
i.ToString());
i
++
;
}
}
private
void
Form1_Resize(
object
sender, EventArgs e)
{
if
(WindowState
==
FormWindowState.Minimized)
{
this
.Visible
=
false
;
this
.notifyIcon1.Visible
=
true
;
}
}
private
void
notifyIcon1_Click(
object
sender, EventArgs e)
{
this
.Visible
=
true
;
WindowState
=
FormWindowState.Normal;
this
.notifyIcon1.Visible
=
false
;
}
private
void
linkLabel1_LinkClicked(
object
sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(
"
http://wuyisky.cnblogs.com
"
);
}
}
}
源码下载
查看全文
相关阅读:
Object的原型拷贝-create、assign、getPrototypeOf 方法的结合
配intelliJ IDEA 过程
浅谈HTTP中Get与Post的区别
apply、call、bind区别、用法
引用类型与原始类型的区别
html5标签集结1
指针作为参数传递
指针与指针变量
函数模板
内置函数
原文地址:https://www.cnblogs.com/wuyisky/p/923247.html
最新文章
基于Visual Studio Code搭建Vue开发环境
ASP.NET Core中使用GraphQL
ASP.NET Core中使用GraphQL
ASP.NET Core中使用GraphQL
ASP.NET Core中使用GraphQL
ASP.NET Core中使用GraphQL
vs2012 error c4996: 'fopen': This function or variable may be unsafe
形态学膨胀初步
前置声明和头文件
uboot1.1.6 start.s分析
热门文章
uboot之---make smdk2410_config命令详细解析
KEA128单片机启动代码分析
TinyOS 代码分析
Tinyos 第三版Make系统
nesC编程入门
angular五种服务详解
Angular Service入门
angular中重要指令介绍($eval,$parse和$compile)
一些网站
jQuery.extend 函数使用详解
Copyright © 2011-2022 走看看