C# Windows Forms Programming user control which consists of three images
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
精彩评论