0
有没有人知道为什么当我运行该程序,并去点击任务栏项目打开小文本输入区域,图标就消失了,只要我到达它! !当我将鼠标悬停在它上面时,C#TaskBar项目消失
非常感谢
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace systemTray
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
this.Visible = false;
}
private void Form1_Resize(object sender, System.EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
{
Hide();
}
}
private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
{
var screen = Screen.PrimaryScreen;
this.Left = screen.WorkingArea.Right - this.Width;
this.Top = screen.WorkingArea.Bottom - this.Height;
Application.Run();
}
private void searchToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void quitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
}
}
编辑:我不知道这是否帮助,但使应用程序无法打开我改变的主要方法从
Application.run(new form1())
到
new form1()
形式
因为这个http://stackoverflow.com/questions/70272/single-form-hide-on-startup – tom 2010-11-22 12:07:45