如何阅读这篇文章 [英] how to go through this article
本文介绍了如何阅读这篇文章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何阅读本文?作者不是在求助,任何专家都可以帮助我们
将窗口最小化到系统托盘 [
how to go through this article? the writer is not rplying can any expert help us out
Minimize window to system tray[^]
First I drag a notifyicon from toolbox to form, and set the icon in property. Then I paste your code to the form as below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace minimizeTray
{
public partial class TrayMinimizerForm : Form
{
public TrayMinimizerForm()
{
InitializeComponent();
}
private void TrayMinimizerForm_Load(object sender, EventArgs e)
{
}
private void TrayMinimizerForm_Resize(object sender, EventArgs e)
{
notifyIcon1.BalloonTipTitle = "Minimize to Tray App";
notifyIcon1.BalloonTipText = "You have successfully minimized your form.";
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(500);
this.Hide();
}
else if (FormWindowState.Normal == this.WindowState)
{
notifyIcon1.Visible = false;
}
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
}
}
}
还有什么我忘了吗?
在此先感谢
is there anything else which i forgot?
thanks in advance
推荐答案
您需要将ReSize表单的事件设置为>> TrayMinimizerForm_Resize代码
You need to set event of your form ReSize to >> TrayMinimizerForm_Resize code
这篇关于如何阅读这篇文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文