Is that possible to set a multi-line textbox a background image?
I have a textbox co开发者_Go百科ntrol (multi-line enabled). Is that possible to assign it a background image?
I'm assuming this is a WinForms application?
There is no 'built-in' way of doing this. You can override the controls paint method (onPaintBackground - I believe) and draw the image yourself.
If it's Web based or WPF - you're in luck.
It's possible. Just add the image location to the text box styling:
<asp:TextBox id="TextBox1" runat="server" style="background-image: url( images/myTextboxImage.jpg ); border: none;" />
EDIT: As Rob pointed out in his answer: this is only if you're doing it on the web.
精彩评论