请教一段简单的Windows窗口程序..
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication13_06
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
}
private void buttonHide_Click(object sender, EventArgs e)
{
this.Hide();
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(6000);
}
private void Form1_Load(object sender, EventArgs e)
{
this.linkLabel1.Links.Add(14, 2);
this.linkLabel1.Links[0].LinkData = "www.baidu.com";
this.linkLabel1.Links[1].LinkData = "form";
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true;
string target = e.Link.LinkData as string;
if (null != target && target.StartsWith("www"))
{
System.Diagnostics.Process.Start(target);
}
else
{
string msg = " 博文站点是电子工业出版社与网 " + Environment.NewLine
+ "站和《程序员》杂志社联合成立的资讯公司。" + Environment.NewLine +
" 博文站点致力于IT专业图书出版,为IT专" + Environment.NewLine +
"业人士提供真正专业、经典的好书。";
MessageBox.Show(msg, "详细信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void linkLabel1_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
this.buttonHide_Click(sender, e);
}
private void buttonExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
麻烦帮解释一下红色部分代码的作用好吗。。我试了一下不知道那个是啥效果啊。。。
拜谢。。