Results 1 to 2 of 2

Thread: PlaceholderTexr

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2025
    Posts
    3

    PlaceholderTexr

    I am new to VB 2026. My laptop has Windows 11, I have reached PlaceholderTexr in the book I am following but it does not seem to work for me. I have a textbox (textbox1) and can see PlaceholderText in the properties. I typed "Please enter you name" into the property and that appeared in the textbox but when I ran the program the textbox was empty. I also tried the line textbox1.PlaceholderTexr = "Please enter you name" in the Form Load event but the box was still empty when I ran the code.

    Am I missing something?

  2. #2
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,631

    Re: PlaceholderTexr

    By design, when a TextBox has focus (contains the blinking cursor), the placeholder text will disappear.

    I would place some dummy control on your form, such as a button, that does nothing. But then, when you run your program, if you click the button, which will give the button focus instead of the TextBox, the placeholder text should re-appear.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width