enter code here
namespace WindowsFormsApplication1
{
public partial class Mainmenu : Form
{
Sendingmail sm = new Sendingmail();
public Mainmenu()
{
InitializeComponent();
}
private void button6_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Normal;
notifyIcon1.Icon = SystemIcons.Exclamation;
notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.BalloonTipTitle = "Patient medicine";
notifyIcon1.BalloonTipText = "Please be noted that a patient should take his medicine now" +
Environment.NewLine +
"click on the icon when medicine given";
notifyIcon1.ShowBalloonTip(20000);
notifyIcon1.Visible = true;
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
Sendingmail sm = new Sendingmail();
sm.Show();
}
當我點擊顯示的通知時,我想要打開一個窗體,我嘗試瞭如上所示的mouseDoubleClick函數,但它也沒有工作。 有什麼幫助嗎?在通知中顯示新表單
你能澄清「沒有工作」嗎?你有沒有得到一個錯誤,或者什麼都沒有?您是否放置了一箇中斷點並查看該事件中的代碼是否正在執行?您似乎已將一些設計器代碼與上面代碼片段中的代碼隱藏代碼混合在一起......這些代碼不會按原樣編譯。 –
Sendingmail sm = new Sendingmail(); sm.Show(); //這就是我所做的,沒有發生任何事情,窗體沒有打開 –
嘗試sm.ShowDialog(); – NickGames