Groups | Blog | Home
all groups > dotnet compact framework > september 2005 >

dotnet compact framework : CF2.0 LinkLabel Control Not Firing Click Event


Tim Brooks
9/14/2005 8:27:08 PM
Anyone know of any issues with the LinkLabel in CF2.0 (VS2005)? I'm
trying to use it combination with Process.Start("IExplore, url)
....etc...etc...and I find the click event doesn't fire.

I've checked to ensure the designer added the event properly and have
even tried hard wiring it but it doesn't seem to fire. I can code
around this annoyance but was just curious. I do knw about OpenNetCF --
before I get deluged about it -- but prefer not to go that route...

thanks in advance...
Peter Foot [MVP]
9/15/2005 8:14:36 AM
LinkLabel contains both the Click (inherited from Control) and LinkClicked
event, make sure you are handling the LinkClicked event.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net

[quoted text, click to view]

Tim Brooks
9/15/2005 7:14:43 PM
[quoted text, click to view]
Peter,

Thanks. I hate to disagree to someone with such clear knowledge of the
topic (i've seen your posts all over the web).....But the LinkLabel
control in my build of CF2.0 (VS2005 Beta 2) doesn't expose a
LinkClicked event. It only exposes the following events:
- Clicked
- EnabledChanged
- ParentChanged
- TextChanged
- CollectionChanging
- CollectionChanged

As for protected methods to potentially override, it only exposes those
of the parent UserControl -- most of which, like the click event -- seem
to be inert. This control seems to be about as useful as teats on bull,
as the expression goes. I'll just write my own.

I understand the design constraints, but man, CF seems to require me to
write half my own controls -- but just think of all that I'm learning.....
Experimented with override some of the parent on_methods.....hmmmm

- GotFocus -- works but not a good solution as it throws repeatedly
without user intervention
- Actually....weird.....just created a test harness for linklabel
control and threw in all the obvious overrides....it's throwing Click
and MouseDown (using overrides)....but EXTREMELY random. I have to
click all around the link and sometimes it fires...sometimes doesn't.
Also, seems to work better clicking on the outer edge of the link test
rather than directly in the middle of it. Whoever wrote the hit testing
on this one must have been high on RedBull or something....I think my
users will think i'm playing a joke on them if I use this....

Oh well, Bill giveth and he taketh away....

Pace
Alex Yakhnin [MVP]
9/16/2005 9:00:03 AM
I've just tested the LinkLabel in the simple test app and it fires Click
event all the time.

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


[quoted text, click to view]
Tim Brooks
9/16/2005 10:32:07 PM
Thanks for trying to help Alex & Peter,

Just some weird glitch. I have now been able to get the click event to
fire in a completely different test app and on a different form within
the same app. But on this particular form it never fires though other
click events -- such as for a button -- fire just fine from the form.

This is a form that started life out in 2003. I initially just let the
import wizard add it....but it does so without the designer.cs file.
I've since completely recreated it and same issue. Strange thing is I'm
not doing anything with the form click event or anything else that would
be cancelling this event. Just bizarre. I'm sure its something I've
done. I'd post the code but its pretty big and I should be able to
clean my own code. Just thought it was a known issue or
something....I'll find it.


[quoted text, click to view]
Tim Brooks
9/16/2005 11:45:38 PM
Ok....one last word on this. Got it to work but makes no sense. Tried
changing everything single property, building, running.....

Try this if you're interested....

* Create a new LinkLabel anywhere....
* Change the textalign property to _*topcenter*_. Event doesn't
fire - on my build anyway...
* Change back to topleft and recompile - fires; OnClick base method
must be hittesting or something in the wrong area. Or else
drawing outside the control area -- which stays on the left.

I can live with this but what a pain....I wish I could have the time it
took to figure this out back....
Several hours over this stupid bug!!!!!

tb

[quoted text, click to view]
Tim Brooks
9/19/2005 8:15:53 PM
Just got word from MS that this was a docmented bug that was resolved in =
the current (most recent? ) build -- though curiously the bug site =
didn't list it and I didn't know it's status until I reported it....
[quoted text, click to view]
Ok....one last word on this. Got it to work but makes no sense. =
Tried changing everything single property, building, running.....

Try this if you're interested....

a.. Create a new LinkLabel anywhere....=20
b.. Change the textalign property to topcenter. Event doesn't fire =
- on my build anyway...

c.. Change back to topleft and recompile - fires; OnClick base =
method must be hittesting or something in the wrong area. Or else =
drawing outside the control area -- which stays on the left.

I can live with this but what a pain....I wish I could have the time =
it took to figure this out back....
Several hours over this stupid bug!!!!!

tb

Alex Yakhnin [MVP] wrote:=20
I've just tested the LinkLabel in the simple test app and it fires Click =

event all the time.=20

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


[quoted text, click to view]

LinkLabel contains both the Click (inherited from Control) and =
LinkClicked=20
event, make sure you are handling the LinkClicked event.

Peter

=20

Peter,

Thanks. I hate to disagree to someone with such clear knowledge of the=20
topic (i've seen your posts all over the web).....But the LinkLabel=20
control in my build of CF2.0 (VS2005 Beta 2) doesn't expose a=20
LinkClicked event. It only exposes the following events:
- Clicked
- EnabledChanged
- ParentChanged
- TextChanged
- CollectionChanging
- CollectionChanged

As for protected methods to potentially override, it only exposes those=20
of the parent UserControl -- most of which, like the click event -- seem =

to be inert. This control seems to be about as useful as teats on bull, =

as the expression goes. I'll just write my own.=20

I understand the design constraints, but man, CF seems to require me to=20
write half my own controls -- but just think of all that I'm =
learning.....
Experimented with override some of the parent on_methods.....hmmmm

- GotFocus -- works but not a good solution as it throws repeatedly=20
without user intervention
- Actually....weird.....just created a test harness for linklabel=20
control and threw in all the obvious overrides....it's throwing Click=20
and MouseDown (using overrides)....but EXTREMELY random. I have to=20
click all around the link and sometimes it fires...sometimes doesn't. =20
Also, seems to work better clicking on the outer edge of the link test=20
rather than directly in the middle of it. Whoever wrote the hit testing =

on this one must have been high on RedBull or something....I think my=20
users will think i'm playing a joke on them if I use this....

Oh well, Bill giveth and he taketh away....

Pace
tim

AddThis Social Bookmark Button