<?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: The Missing .NET #1: Cue Banners in Windows Forms (EM_SETCUEBANNER, Text Prompt)</title>
	<atom:link href="http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/</link>
	<description>Trapped online since 2004</description>
	<pubDate>Tue, 06 Jan 2009 12:45:50 +0000</pubDate>
	<generator>http://wordpress.org/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alexander Klimov</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-587</link>
		<dc:creator>Alexander Klimov</dc:creator>
		<pubDate>Sat, 20 Dec 2008 20:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-587</guid>
		<description>You can to using CB_SETCUEBANNER message for ComboBox instead of call GetComboBoxInfo and COMBOBOXINFO. It is simplier

comboBox1.Items.Add("Dollar");
comboBox1.Items.Add("Euro");
comboBox1.Items.Add("Rubel");
// set banner
SendMessage(comboBox1.Handle, CB_SETCUEBANNER, 0, "Choose...");</description>
		<content:encoded><![CDATA[<p>You can to using CB_SETCUEBANNER message for ComboBox instead of call GetComboBoxInfo and COMBOBOXINFO. It is simplier</p>
<p>comboBox1.Items.Add(&#8221;Dollar&#8221;);<br />
comboBox1.Items.Add(&#8221;Euro&#8221;);<br />
comboBox1.Items.Add(&#8221;Rubel&#8221;);<br />
// set banner<br />
SendMessage(comboBox1.Handle, CB_SETCUEBANNER, 0, &#8220;Choose&#8230;&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Missing .NET #4: Cue Banner in WPF (I mean, Watermark in WPF) &#124; a geek trapped in a cool guy&#8217;s body</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-262</link>
		<dc:creator>The Missing .NET #4: Cue Banner in WPF (I mean, Watermark in WPF) &#124; a geek trapped in a cool guy&#8217;s body</dc:creator>
		<pubDate>Mon, 02 Jun 2008 18:28:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-262</guid>
		<description>[...] regular reader would know I&#8217;m quite enamoured with the Cue Banner as UI tool. Once again, in WPF, Microsoft missed something fairly obvious for inclusion; and really [...]</description>
		<content:encoded><![CDATA[<p>[...] regular reader would know I&#8217;m quite enamoured with the Cue Banner as UI tool. Once again, in WPF, Microsoft missed something fairly obvious for inclusion; and really [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaya Labo</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-256</link>
		<dc:creator>Jaya Labo</dc:creator>
		<pubDate>Mon, 26 May 2008 09:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-256</guid>
		<description>Actually the message should have read like this
Hi
Thanks a lot !! You are simply great.
It worked. I changed the sendmessage code to

" _
Public Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr
End Function"</description>
		<content:encoded><![CDATA[<p>Actually the message should have read like this<br />
Hi<br />
Thanks a lot !! You are simply great.<br />
It worked. I changed the sendmessage code to</p>
<p>&#8221; _<br />
Public Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr<br />
End Function&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaya Labo</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-255</link>
		<dc:creator>Jaya Labo</dc:creator>
		<pubDate>Mon, 26 May 2008 09:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-255</guid>
		<description>Hi
Thanks a lot !! You are simple great.
It worked. I changed the sendmessage code to

     _
    Public Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr
    End Function</description>
		<content:encoded><![CDATA[<p>Hi<br />
Thanks a lot !! You are simple great.<br />
It worked. I changed the sendmessage code to</p>
<p>     _<br />
    Public Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr<br />
    End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-254</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Mon, 26 May 2008 00:28:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-254</guid>
		<description>@Jaya Labo: OK, we found the problem I think: SendMessageA uses ANSI text. The string for EM_SETCUEBANNER must be Unicode. Try one of the following in your declaration of SendMessage:

Declare Function SendMessage Lib "user32.dll" Alias "SendMessage" (...)

or

Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (...)

Either of those should work, however, let me recommend the first one. In general you want the Function name to correspond to the Alias name to keep them clear in your mind. Hopefully this works for you!</description>
		<content:encoded><![CDATA[<p>@Jaya Labo: OK, we found the problem I think: SendMessageA uses ANSI text. The string for EM_SETCUEBANNER must be Unicode. Try one of the following in your declaration of SendMessage:</p>
<p>Declare Function SendMessage Lib &#8220;user32.dll&#8221; Alias &#8220;SendMessage&#8221; (&#8230;)</p>
<p>or</p>
<p>Declare Function SendMessage Lib &#8220;user32.dll&#8221; Alias &#8220;SendMessageW&#8221; (&#8230;)</p>
<p>Either of those should work, however, let me recommend the first one. In general you want the Function name to correspond to the Alias name to keep them clear in your mind. Hopefully this works for you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaya Labo</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-253</link>
		<dc:creator>Jaya Labo</dc:creator>
		<pubDate>Sun, 25 May 2008 09:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-253</guid>
		<description>I forgot one line in the previous reply

    Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr

Sorry for that.</description>
		<content:encoded><![CDATA[<p>I forgot one line in the previous reply</p>
<p>    Declare Function SendMessage Lib &#8220;user32.dll&#8221; Alias &#8220;SendMessageA&#8221; (ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr</p>
<p>Sorry for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaya Labo</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-252</link>
		<dc:creator>Jaya Labo</dc:creator>
		<pubDate>Sun, 25 May 2008 09:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-252</guid>
		<description>Thanks for the immediate response !
It is on a 32 bit processor and the relevant code in VB.net is

Public Class LabelTextBox
    Inherits TextBox

    Private Shared ECM_FIRST As UInteger = 5376
    Private Shared EM_SETCUEBANNER As UInteger = ECM_FIRST + 1

    Private _promptText As String = [String].Empty

     _
     _
     _
    Public Property PromptText() As String
        Get
            Return _promptText
        End Get
        Set(ByVal value As String)
              _promptText = value
              UpdatePrompt()
        End Set
    End Property

    Private Sub UpdatePrompt()
        If Me.IsHandleCreated Then
SendMessage(New HandleRef(Me, Me.Handle), EM_SETCUEBANNER, New IntPtr(1), _promptText)
        End If
    End Sub
End Class</description>
		<content:encoded><![CDATA[<p>Thanks for the immediate response !<br />
It is on a 32 bit processor and the relevant code in VB.net is</p>
<p>Public Class LabelTextBox<br />
    Inherits TextBox</p>
<p>    Private Shared ECM_FIRST As UInteger = 5376<br />
    Private Shared EM_SETCUEBANNER As UInteger = ECM_FIRST + 1</p>
<p>    Private _promptText As String = [String].Empty</p>
<p>     _<br />
     _<br />
     _<br />
    Public Property PromptText() As String<br />
        Get<br />
            Return _promptText<br />
        End Get<br />
        Set(ByVal value As String)<br />
              _promptText = value<br />
              UpdatePrompt()<br />
        End Set<br />
    End Property</p>
<p>    Private Sub UpdatePrompt()<br />
        If Me.IsHandleCreated Then<br />
SendMessage(New HandleRef(Me, Me.Handle), EM_SETCUEBANNER, New IntPtr(1), _promptText)<br />
        End If<br />
    End Sub<br />
End Class</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-251</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Sat, 24 May 2008 19:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-251</guid>
		<description>@Jaya Labo: The problem in Windows XP isn't that the cue banner shows up in an East Asian Language; it's that if an East Asian language pack is installed, then the cue banner doesn't show up at all. Essentially, you have to pick one or the other.

If you're seeing the cue text, but it shows up as a different language, it might be an encoding problem. Are you running on a 32-bit or 64-bit processor?

Post the relevant code, and I might be able to help you.</description>
		<content:encoded><![CDATA[<p>@Jaya Labo: The problem in Windows XP isn&#8217;t that the cue banner shows up in an East Asian Language; it&#8217;s that if an East Asian language pack is installed, then the cue banner doesn&#8217;t show up at all. Essentially, you have to pick one or the other.</p>
<p>If you&#8217;re seeing the cue text, but it shows up as a different language, it might be an encoding problem. Are you running on a 32-bit or 64-bit processor?</p>
<p>Post the relevant code, and I might be able to help you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaya Labo</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-250</link>
		<dc:creator>Jaya Labo</dc:creator>
		<pubDate>Sat, 24 May 2008 15:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-250</guid>
		<description>Fantastic !!
I am using VS 2008 on Vista Ultimate. It gives the same problem as for Win XP, i.e. it shows Cue Text in some East Asian language. I have checked my system. No language pack has been installed. Otherwise it works fine especially your tip for wparam. Can you help ?</description>
		<content:encoded><![CDATA[<p>Fantastic !!<br />
I am using VS 2008 on Vista Ultimate. It gives the same problem as for Win XP, i.e. it shows Cue Text in some East Asian language. I have checked my system. No language pack has been installed. Otherwise it works fine especially your tip for wparam. Can you help ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Missing .NET #3: An AutoComplete TextBox in WPF, Part 2 - Making it reusable &#124; a geek trapped in a cool guy&#8217;s body</title>
		<link>http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/comment-page-1/#comment-223</link>
		<dc:creator>The Missing .NET #3: An AutoComplete TextBox in WPF, Part 2 - Making it reusable &#124; a geek trapped in a cool guy&#8217;s body</dc:creator>
		<pubDate>Tue, 13 May 2008 11:08:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ageektrapped.com/blog/the-missing-net-1-cue-banners-in-windows-forms-em_setcuebanner-text-prompt/#comment-223</guid>
		<description>[...] first draftIt&#8217;s in the Framework, Dummy!The Missing .NET #2: Collection&#60;T&#62; AddRange()The Missing .NET #1: Cue Banners in Windows Forms (EM_SETCUEBANNER, Text Prompt)A Fast Equals() - Remember to Always [...]</description>
		<content:encoded><![CDATA[<p>[...] first draftIt&#8217;s in the Framework, Dummy!The Missing .NET #2: Collection&lt;T&gt; AddRange()The Missing .NET #1: Cue Banners in Windows Forms (EM_SETCUEBANNER, Text Prompt)A Fast Equals() - Remember to Always [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
