开发者

C# Windows Forms Programming user control which consists of three images

开发者 https://www.devze.com 2023-02-16 22:19 出处:网络
Itry to create a user control (button). The button background consists of three images. The left border of the button, the r开发者_JAVA百科ight border and middle part that stretched depending on the t

I try to create a user control (button). The button background consists of three images. The left border of the button, the r开发者_JAVA百科ight border and middle part that stretched depending on the text. How can I realized this?


Basically, you have to derive from Button (or Control, depends how deep you want to go) and override OnPaint. You will have to handle all states (normal, pushed) and be responsible for refreshing them. Like here for example:

http://christian-helle.blogspot.com/2007/09/buttonex-owner-drawn-button-control.html

0

精彩评论

暂无评论...
验证码 换一张
取 消