C # icon on button (resize)

I created two buttons with an image inside them, acting as an icon. Using the ImageBeforeText parameter in the TextImageRelation property, they look like this:

enter image description here

If I chose a large image for a small button, it would span the entire button; if I chose a small image for a large button, it would look tiny in comparison. Also, I use a TableLayoutPanel and assign percentages to each row and column, so all controls (including these two buttons) are proportional to each other and still look "organized" if the form is modified or a different resolution is used.

This is the problem: so if I resize the form, these two buttons and all other controls go with it (because of the TableLayoutPanel), but the icons on those two buttons don't. Is there a way I can make sure the icons resize so that they can be proportional to their buttons?

+3


source to share


1 answer


you have to set the AutoSize

property for your button to valueFalse



-2


source







All Articles