Button on image change is larger than button size

shams 21 Reputation points
2021-09-09T08:18:41.867+00:00

in vb.net 2019
when i press the button , the button image change and thats ok
but the problem that when the image i loaded it is out of button size
i try the code:

button1.Image = My.Resources.Closed_position_vertical
button1.BackgroundImageLayout = ImageLayout.Stretch
button1.ImageAlign = ContentAlignment.MiddleCenter

but it not achieve the target
thanks

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,637 questions
{count} votes