Re: Clickable Label revisited by Chris
Chris
Fri Oct 24 14:06:56 CDT 2003
It doesn't do anything because the Label doesn't implement a click event.
It inherits from Control, so the event shows up, but under the hood, it
never raises the event.
--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net
"William Ryan" <dotnetguru@comcast.nospam.net> wrote in message
news:uFNkpskmDHA.2732@TK2MSFTNGP11.phx.gbl...
> I know that it doesn't work, I'm just wondering why b/c it's a method of
> click and the PictureBox for instance can do it effectively.
>
> The fact that they left it in and is an oversight though explains it.
>
> Thanks,
>
> Bill
> "Garth" <anonymous@discussions.microsoft.com> wrote in message
> news:0b7e01c39a45$2a498cb0$a601280a@phx.gbl...
> > The click event is not supported for labels.
> > THis is allowed but is an oversight by MS or they plan to
> > implement this in the future. Currently you cannot get
> > click notification for a label.
> >
> > Write your own.
> >
> > Garth
> >
> >
> > >-----Original Message-----
> > >I'm familiar with the label examples and understand them.
> > >
> > >Here's what I don't understand though....if I drag a
> > label onto a form and
> > >add this event handler, it's kosher
> > >this.label1.Click += new System.EventHandler
> > (this.label1_Click);
> > >
> > >Now, if I add a hanlder for label1_click like so:
> > >
> > >private void label1_Click(object sender,
> > System.EventArgs e)
> > >
> > >{MessageBox.Show("It Worked");}
> > >
> > >And I click on the label, nothing happens. however, the
> > event does show up
> > >in this.label1. and I thought all controls had click as
> > an event.
> > >
> > >If I do the EXACT same thign with a PictureBox, it works
> > fine. When I click
> > >on the label nothing, click on the pictureBox works as
> > expected.
> > >
> > >I don't need to use a clickable label at the moment, but
> > I'm wondering why
> > >this behavior is what it is?
> > >
> > >TIA,
> > >
> > >
> > >
> > >Bill
> > >
> > >
> > >
> > >
> > >.
> > >
>
>