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