Some Wisej way to set textbox image placeholder

Answered
0
0

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!

Attachment
  • You must to post comments
Best Answer
0
0

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-repeat:no-repeat;
    background-image:url(Ok-24.png);
    background-position: left center;
    padding-left: 20px;
}

Then in the textBox CssClass property put “search”.

See below:

textbox-with-image

  • 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.