Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post

    Creating placeholder help

    Hi friends,
    i want your help for creating placeholder for textbox in vb.net using c# language

  • #2
    New Coder
    Join Date
    Jul 2013
    Posts
    48
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Textbox myTxtbx = new Textbox();
    myTxtbx.Text = "Enter text here...";

    myTxtbx.OnFocus += OnFocus.EventHandle(RemoveText);
    myTxtbx.LoseFocus += LoseFocus.EventHandle(AddText);

    public RemoveText(object sender, EventArgs e)
    {
    myTxtbx.Text = "";
    }

    public AddText(object sender, EventArgs e)
    {
    if(myTxtbx.Text == "")
    myTxtbx.Text = "Enter text here...";
    }


  •  

    Posting Permissions

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