2

as you can see in the code below, the form will be hidden if the deactivate event is triggered, and the form will be shown again if notifyIcon clicked, the problem is, when form state is visible, then notifyIcon is clicked, the form will be hidden and immediatly shown again, I do not want this behavior, please someone help me.

    private void FormMain_Deactivate(object sender, EventArgs e)
    {
        this.Hide();
    }

    private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Left)
        {
            this.Show();
            this.Activate();
        }
    }
4

3 に答える 3

-2
private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        If (!this.isVisible)
        {
             this.Show();
             this.Activate();
        }
    }
}

私は今、私の側から離れているので、暗闇の中で突き刺してください...頑張ってください:-)

于 2013-05-30T04:18:59.130 に答える