0

I'm trying to set a default value in a text input field which gives the user an example of what to enter. This should be in grey color and should disappear as soon as they start typing.

1 Answers1

1

Add a placeholder attribute in code behind - if your textbox is

<asp:textbox runat="server" ID="mytextbox" />

Then in code behind add

mytextbox.Attributes.Add("placeholder", "example text")

[edit] - sorry, I'm thinking of web forms, not windows forms...

[edit] see here: Placeholder in TextBox in Window Forms using VB.NET

PSU
  • 175
  • 1
  • 9