Answers for "how to add placeholder in textbox in windows form"

0

how to add placeholder in textbox in windows form

private void Form_load(object sender, EventArgs e)
{
    textBox.Text = "Place Holder text..."
}

private void textBox_Enter(object sender, EventArgs e)
{
    if(textBox.Text == "Place Holder text...")
    {
        textBox.Text = ""
    }
}

private void textBox_Leave(object sender, EventArgs e)
{
    if(textBox.Text == "")
    {
        textBox.Text = "Place Holder text..."
    {
}
Posted by: Guest on July-20-2021

Code answers related to "how to add placeholder in textbox in windows form"

Browse Popular Code Answers by Language