Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6072553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:10:22+00:00 2026-05-23T10:10:22+00:00

Visual C#.NET: private void tbAddress_GotFocus() { tbAddress.Text = ; } private void tbAddress_LostFocus() {

  • 0

Visual C#.NET:

    private void tbAddress_GotFocus()
    {
        tbAddress.Text = "";
    }

    private void tbAddress_LostFocus()
    {
        if (tbAddress.Text == "") { tbAddress.Text = "Email Address"; }
    }

So, I’m trying to use that code to make it so there is text in a (Windows Forms) textbox, and then when the textbox gets focus (when the user clicks inside of it), the text disappears. That way it looks like a form with the label inside the textbox.

So, why doesn’t that code work, or is there a better way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:10:23+00:00Added an answer on May 23, 2026 at 10:10 am

    Here’s a tutorial on how to do watermarks in textboxes.

    http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio.NET when coding I constantly use (no selection) CTRL-C, CTRL-V to make
I use Visual Studio .NET to create a Windows-based application. The application includes a
I use Visual Studio .NET to develop a component named X_Component and I plan
I use Visual Studio .NET to develop internal applications. I create a Windows control
Consider the following code (written with Visual Studio 2010 and .NET 4.0) using System;
I have an ASP.NET MVC application, with some RESTful services that I'm trying to
Now that I have built a database. Visual Studio 2008 SP1’s ADO.NET Entity Framework
I have this code and I am trying to run it on a .NET
Does Visual Studio .NET have a way to toggle word-wrap on and off? I
Assuming Visual Studio.NET 2008 and MsTest are used to run unit tests. When a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.