Some Wisej way to set textbox image placeholder


Some wisej way (properties) to set textbox image placeholder?
I tried with BackgroundImageSource and BackgroundImageLayout but seems not working.

Some like in css:
input#search {
background-image: url(bg.jpg);
background-repeat: no-repeat;
text-indent: 20px;
See attached image!
Thanks in advance!

  • You must to post comments
Best Answer

You can do it in many ways, depends on what you need. I tried the textBox.BackgroundImage and it works, but it’s what it is, a background image. It probably shouldn’t be used on a textbox unless you want some fancy background.

You can also use the Tools property to add a clickable small toolbutton inside the textbox either on the left or on the right. You can have multiple tools. The Tools collection is present on most editable controls and many others.

Or you can use css. Add  a stylesheet extender and use this:

.search input
    background-size: 16px;
    background-position: left center;
    padding-left: 20px;

Then in the textBox CssClass property put “search”.

See below:


  • Ser Gar
    Great answers! I didn’t know about tools property. Thanks!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.