i forgot how to do this someone help
how do i make this into one
private void mnuTray_Click(object sender, System.EventArgs e)
{
notifyIcon1.Visible = true; WindowState =
FormWindowState.Minimized; Hide();
}
private void lnkTray_LinkClicked(object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
notifyIcon1.Visible = true; WindowState =
FormWindowState.Minimized; Hide();
}
I remember I had to change it to something
like --------------------------------
private void mnuTray_Click(object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs , System.EventArgs e)
{
notifyIcon1.Visible = true; WindowState =
FormWindowState.Minimized; Hide();
}
rossum - 06 Sep 2007 20:59 GMT
>i forgot how to do this someone help
>
[quoted text clipped - 12 lines]
>FormWindowState.Minimized; Hide();
> }
Have you tried:
private void lnkTray_LinkClicked(object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
mnuTray_Click(sender, e);
}
to call the first button click action when the second button is
clicked?
rossum
>I remember I had to change it to something
>like --------------------------------
[quoted text clipped - 5 lines]
>FormWindowState.Minimized; Hide();
> }
Nicholas Paldino [.NET/C# MVP] - 06 Sep 2007 21:05 GMT
The neater way would be to refactor this into a single method, like so:
private void LinkClickedEventHandler()
{
notifyIcon1.Visible = true;
WindowState = FormWindowStateMinimized;
Hide();
}
And then call that from each event handler.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
>>i forgot how to do this someone help
>>
[quoted text clipped - 34 lines]
>>FormWindowState.Minimized; Hide();
>> }
Al Biheiri - 06 Sep 2007 21:11 GMT
yea that works...should of thought about that,,,, woops
> The neater way would be to refactor this into a single method, like so:
>
[quoted text clipped - 45 lines]
>>>FormWindowState.Minimized; Hide();
>>> }
zacks@construction-imaging.com - 06 Sep 2007 21:01 GMT
> i forgot how to do this someone help
>
[quoted text clipped - 22 lines]
> FormWindowState.Minimized; Hide();
> }
Typo in my last. Should be:
In the mnuTray_Click event handler, substitute the following code for
what is there:
InkTray.PerformClick();