I have a ComboBox on my application which displays a watermark 'Search...'
The watermark is added using CB_SETCUEBANNER:
'Private Const EM_SETCUEBANNER As Integer = &H1501 (TextBox)
Private Const CB_SETCUEBANNER As Integer = &H1703 '(ComboBox)
<DllImport("user32.dll", EntryPoint:="SendMessageW")> _
Private Shared Function SendMessageW(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As UInteger, <MarshalAs(UnmanagedType.LPTStr)> ByVal lParam As String) As Integer
End Function
SendMessageW(CBSearch.Handle, CB_SETCUEBANNER, 0, "Search...")
I want the SETCUEBANNER text 'Search...' to be italic. Is there a way to pass an additional parameter to SETCUEBANNER?
Many thanks for your help.
What I have tried:
I tried passing an additional parameter through on the SendMessageW:
<DllImport("user32.dll", EntryPoint:="SendMessageW")> _
Private Shared Function SendMessageW(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As UInteger, ByVal styleItalic As FontStyle, <MarshalAs(UnmanagedType.LPTStr)> ByVal lParam As String) As Integer
End Function
SendMessageW(CBSearch.Handle, CB_SETCUEBANNER, 0, FontStyle.Italic, "Search...")