Skip to content

Instantly share code, notes, and snippets.

@ruel
Created August 6, 2012 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruel/3271233 to your computer and use it in GitHub Desktop.
Save ruel/3271233 to your computer and use it in GitHub Desktop.
CueProvider for VB.NET
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Namespace CueProvider
Class CueProvider
Private Const EM_SETCUEBANNER As Integer = &H1501
<DllImport("user32.dll", CharSet := CharSet.Auto)> _
Private Shared Function SendMessage(hWnd As IntPtr, msg As Integer, wParam As Integer, <MarshalAs(UnmanagedType.LPWStr)> lParam As String) As Int32
End Function
Public Shared Sub SetCue(txtBox As TextBox, text As String)
SendMessage(txtBox.Handle, EM_SETCUEBANNER, 0, text)
End Sub
Public Shared Sub ClearCue(txtBox As TextBox)
SendMessage(txtBox.Handle, EM_SETCUEBANNER, 0, String.Empty)
End Sub
End Class
End Namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment