[Mono-winforms-list] NotifyIcon OnClick

Nicolas scalpmail at gmail.com
Sun Jan 4 13:50:34 EST 2009


This make sense :)
Thank for the answer.

Regards,
Nico

On Sun, Jan 4, 2009 at 5:44 PM, Ivan N. Zlatev <contact at i-nz.net> wrote:

> On Sat, Jan 3, 2009 at 1:17 PM, n i c o <scalpmail+nabble at gmail.com<scalpmail%2Bnabble at gmail.com>>
> wrote:
> >
> > Hello,
> >
> > I'm trying to port an application to mono and I'm facing a problem:
> > On Windows + .Net, when I click on a notifyIcon, I can cast the EventArgs
> > argument to a MouseEventArgs event in order to get which mouse button is
> > clicked.
>
> This is a hack that depends on an implementation detail in the
> Microsoft implementation. In the next version they might change their
> behavior and your code will break.
>
> > In Mono, the argumement cannot be cast. How do I do that ?
> >
> >        private void notifyIcon_Click(object sender, EventArgs e)
> >        {
> >            if (((MouseEventArgs)e).Button == MouseButtons.Left)
> >            {
> >                //
> >            }
> >        }
> >
>
> You should use the static properties Control.MouseButtons and
> Control.MousePosition.
>
> > Thanks in advance,
> > Nico
> > --
> > View this message in context:
> http://www.nabble.com/NotifyIcon-OnClick-tp21263967p21263967.html
> > Sent from the Mono - WinForms mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> >
>
>
>
> --
> Kind Regards,
> Ivan N. Zlatev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090104/e3bbe612/attachment.html 


More information about the Mono-winforms-list mailing list