gpt4 book ai didi

c# - winform中的图标按钮布局

转载 作者:行者123 更新时间:2023-11-30 12:42:38 30 4
gpt4 key购买 nike

我正在使用 Windows 8、VS 2012。我在我的按钮上添加了一个圆形图标:

this.btn.Image = Properties.Resources.icon;
this.btn.Size = Properties.Resources.icon.Size;

我的表单也有背景图片:

this.BackgroundImage = Properties.Resources.sunset;

但我的形式变得很丑陋,我的图标按钮是方形的:中间是圆形图像,角落是灰色。

问题是如何显示表单背景而不是灰色?

enter image description here

感谢您的关注

最佳答案

你可以设置你的按钮的一些属性来获得你需要的:

  • 将按钮的 FlatStyle 属性更改为 Flat
  • 将其 BackColor 属性设置为 Transparent
  • FlatAppearance中将BorderSize设为0。
  • FlatAppearance 中,您还可以将 MouseDownBackColorMouseOverBackColor 设置为窗体的背景颜色或您想要的颜色。

enter image description here

关于c# - winform中的图标按钮布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32964373/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com