Kako da klikom na ikonicu u SysTray-u, dovedem formu na prvo mesto jer je forma ostala iza nekih drugih, recimo Mozille?
Kako da dovedem formu u fokus?
Zakačeno
Mozda nisam bio precizan: Hocu formu da BringToFront.
Resio sam:
Code:
void notifyIcon1Click(object sender, System.EventArgs e)
{
this.Activate();
}
void notifyIcon1Click(object sender, System.EventArgs e)
{
this.Activate();
}
Deklarisi sledecu funkciju:
A onda u, recimo, DoubleClick event handler-u za NotifyIcon uradi sledece:
Gde je this referenca na formu;
Code:
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
A onda u, recimo, DoubleClick event handler-u za NotifyIcon uradi sledece:
Code:
SetForegroundWindow(this.Handle);
SetForegroundWindow(this.Handle);
Gde je this referenca na formu;
Potpis
If it's a girl then they're gonna call it Sigourney, after an actress. If it's a boy, then they're gonna call it Rodney, after Dave!
Citat:
havramm: Deklarisi sledecu funkciju: ...
Sto prosto kad moze kompikovano...
Dok sam ja pisao odgovor, on resio...
Potpis
If it's a girl then they're gonna call it Sigourney, after an actress. If it's a boy, then they're gonna call it Rodney, after Dave!
Da, u pravu si moze i tako
.