Can a background image be set on a Winforms TextBox?

前端 未结 2 1206
Happy的楠姐
Happy的楠姐 2020-12-03 10:31

Is it possible to change the background image of a Windows Forms TextBox in C#? There is no BackgroundImage property. Should I override the P

2条回答
  •  無奈伤痛
    2020-12-03 11:15

    If you're up to some native coding, you could try to use the technique mentioned here: http://www.codedblog.com/2007/09/17/owner-drawing-a-windowsforms-textbox (Edit: original link is down, thnx Zyo, replaced it with link to archived copy in the wayback machine.)

    Although the article is about drawing something in a textbox after the textbox is drawn (not before), perhaps it could be modified to accomplish what you need.

提交回复
热议问题