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
"
);
}
}
}
源码下载
查看全文
相关阅读:
css中position的两种定位(absolute、relative)
C# 如何转换生成长整型的时间
C# 如何转换生成长整型的时间
C# 如何转换生成长整型的时间
easyui dialog的一个小坑
easyui dialog的一个小坑
ACM2027
[VUE]关于路由哪些事儿
hexo+github
我们一起学React Native(一):环境配置
原文地址:https://www.cnblogs.com/wuyisky/p/923247.html
最新文章
【codeforces 755F】PolandBall and Gifts
【codeforces 701C】They Are Everywhere
【codeforces 509A】Maximum in Table
【codeforces 509B】Painting Pebbles
【codeforces 509E】Pretty Song
【codeforces 509C】Sums of Digits
【codeforces 508A】Pasha and Pixels
【codeforces 508B】Anton and currency you all know
【codeforces 508C】Anya and Ghosts
【codeforces 801A】Vicious Keyboard
热门文章
android获取系统wifi状态等
PHP聊天室开源系统workerman-chat
Android WiFi管理(WIFI_SERVICE)
linux安装安卓开发工具android studio
抛弃win
异构云操作系统的集成与统一调度框架及调度方法
汇总jQuery的61种选择器及示例
汇总jQuery的61种选择器及示例
css中position的两种定位(absolute、relative)
css中position的两种定位(absolute、relative)
Copyright © 2011-2022 走看看