<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: LinkLabel with the correct Hand Cursor</title>
	<atom:link href="http://wyday.com/blog/2008/linklabel-with-the-correct-hand-cursor/feed/" rel="self" type="application/rss+xml" />
	<link>http://wyday.com/blog/2008/linklabel-with-the-correct-hand-cursor/</link>
	<description>Design articles to make your users deliriously happy</description>
	<lastBuildDate>Wed, 16 May 2012 16:28:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Peter</title>
		<link>http://wyday.com/blog/2008/linklabel-with-the-correct-hand-cursor/comment-page-1/#comment-12297</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 01 Nov 2010 20:38:58 +0000</pubDate>
		<guid isPermaLink="false">http://wyday.com/blog/?p=106#comment-12297</guid>
		<description>Nevermind, I came up with a quick and dirty workaround:

&lt;pre&gt;
    Protected Overrides Sub WndProc(ByRef m As Message)
        Const WM_SETCURSOR As Integer = 32
        If hoveringOverMediabutton Then
            If m.Msg = WM_SETCURSOR Then
                &#039;IDC_HAND = 32649
                &#039;IDC_ARROW = 32512
                SetCursor(LoadCursor(0, 32649))
                &#039;the message has been handled
                m.Result = IntPtr.Zero
                Return
            End If
        Else
            If m.Msg = WM_SETCURSOR Then
                &#039;IDC_HAND = 32649
                &#039;IDC_ARROW = 32512
                SetCursor(LoadCursor(0, 32512))
                &#039;the message has been handled
                m.Result = IntPtr.Zero
                Return
            End If
        End If

        MyBase.WndProc(m)
    End Sub
&lt;/pre&gt;

hoveringOverMediabutton is a boolean defined by me.
If it&#039;s true, a hand cursor is set, if it&#039;s false, the default (arrow) cursor is set.
Thanks for the initial code! :)</description>
		<content:encoded><![CDATA[<p>Nevermind, I came up with a quick and dirty workaround:</p>
<pre>
    Protected Overrides Sub WndProc(ByRef m As Message)
        Const WM_SETCURSOR As Integer = 32
        If hoveringOverMediabutton Then
            If m.Msg = WM_SETCURSOR Then
                'IDC_HAND = 32649
                'IDC_ARROW = 32512
                SetCursor(LoadCursor(0, 32649))
                'the message has been handled
                m.Result = IntPtr.Zero
                Return
            End If
        Else
            If m.Msg = WM_SETCURSOR Then
                'IDC_HAND = 32649
                'IDC_ARROW = 32512
                SetCursor(LoadCursor(0, 32512))
                'the message has been handled
                m.Result = IntPtr.Zero
                Return
            End If
        End If

        MyBase.WndProc(m)
    End Sub
</pre>
<p>hoveringOverMediabutton is a boolean defined by me.<br />
If it&#8217;s true, a hand cursor is set, if it&#8217;s false, the default (arrow) cursor is set.<br />
Thanks for the initial code! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://wyday.com/blog/2008/linklabel-with-the-correct-hand-cursor/comment-page-1/#comment-12291</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 01 Nov 2010 17:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://wyday.com/blog/?p=106#comment-12291</guid>
		<description>Um...
While using that bit of code(the same as above, just converted to VB.NET):

&lt;pre&gt;
    Protected Overrides Sub WndProc(ByRef m As Message)
        &#039;WM_SETCURSOR == 32
        If m.Msg = 32 Then
            &#039;IDC_HAND == 32649
            SetCursor(LoadCursor(0, 32649))

            &#039;the message has been handled
            m.Result = IntPtr.Zero
            Return
        End If

        MyBase.WndProc(m)
    End Sub
&lt;/pre&gt;

I noticed that the cursor is not set back to default unless I set the cursor somewhere else (e.g. by hovering over the form).
Is there a simple way to fix this?</description>
		<content:encoded><![CDATA[<p>Um&#8230;<br />
While using that bit of code(the same as above, just converted to VB.NET):</p>
<pre>
    Protected Overrides Sub WndProc(ByRef m As Message)
        'WM_SETCURSOR == 32
        If m.Msg = 32 Then
            'IDC_HAND == 32649
            SetCursor(LoadCursor(0, 32649))

            'the message has been handled
            m.Result = IntPtr.Zero
            Return
        End If

        MyBase.WndProc(m)
    End Sub
</pre>
<p>I noticed that the cursor is not set back to default unless I set the cursor somewhere else (e.g. by hovering over the form).<br />
Is there a simple way to fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo Amaral</title>
		<link>http://wyday.com/blog/2008/linklabel-with-the-correct-hand-cursor/comment-page-1/#comment-4477</link>
		<dc:creator>Ricardo Amaral</dc:creator>
		<pubDate>Sat, 15 Aug 2009 11:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://wyday.com/blog/?p=106#comment-4477</guid>
		<description>Yep, I was aware that LinkLabel2 derived from Control and not Label. I could change the source code and include that in my app but I didn&#039;t want to cause if you release a new version, I need to keep updating my version, which is boring lol.

About the resizing and stuff... I&#039;m only using this ONCE and in an about box, which is fixed size, there will be no repainting whatsoever, so, that&#039;s not an issue in my application. The form is not that wide either, so it won&#039;t take that long to paint the label on the form. But this is just me and how I use the control (at least for now).

And it is the only to align the label IF I don&#039;t want to do it manually by code, that&#039;s what I was trying to say. Of course I can always handle the more appropriate event to see if the size changed and align it manually, but that&#039;s what I wanted to avoid.

But if that&#039;s the only way, I guess I have no choice...</description>
		<content:encoded><![CDATA[<p>Yep, I was aware that LinkLabel2 derived from Control and not Label. I could change the source code and include that in my app but I didn&#8217;t want to cause if you release a new version, I need to keep updating my version, which is boring lol.</p>
<p>About the resizing and stuff&#8230; I&#8217;m only using this ONCE and in an about box, which is fixed size, there will be no repainting whatsoever, so, that&#8217;s not an issue in my application. The form is not that wide either, so it won&#8217;t take that long to paint the label on the form. But this is just me and how I use the control (at least for now).</p>
<p>And it is the only to align the label IF I don&#8217;t want to do it manually by code, that&#8217;s what I was trying to say. Of course I can always handle the more appropriate event to see if the size changed and align it manually, but that&#8217;s what I wanted to avoid.</p>
<p>But if that&#8217;s the only way, I guess I have no choice&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
