Is there a way to put a watermark in a text box? I have sen it on web
sites but i would like to create a persistant translucent one in the
background
I don't know of any easy way to do this. The "hard" way is to create a
user drawn textbox, but this gets a little funky when it comes to
selecting and deleting text.
Here's some quick code that draws a red line through the textbox:
Public Class UDtextbox
Inherits TextBox
Sub New()
MyBase.New()
Me.SetStyle(ControlStyles.UserPaint, True)
End Sub
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
Dim g As Graphics = e.Graphics
g.DrawLine(Pens.Red, 0, 3, Me.Width, 3)
g.Dispose()
End Sub
End Class
Good luck!
Thanks,
Seth Rowe