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