Created
August 6, 2012 06:07
-
-
Save ruel/3271233 to your computer and use it in GitHub Desktop.
CueProvider for VB.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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