在 winforms 应用程序中更改按钮图像大小

Q-b*_*uit 3 c# winforms

我试图使按钮上的图标变小,但我不知道如何。

在此处输入图片说明

图像的大小变灰。

在此处输入图片说明

知道如何解决这个问题吗?

Rom*_*mbé 9

您需要调整大小Image,然后将其设置为Buttons图像:

// where 'MyImage' is the Image to display on the Button
this.Button1.Image = (Image)(new Bitmap(MyImage, new Size(32,32)));
Run Code Online (Sandbox Code Playgroud)