I try to create a user control (button). The button background consists of three images. The left border of the button, the right border and middle part that stretched depending on the text. How can I realized this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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