更新按钮 VB.net 上的图像
我正在尝试制作一个显示图像的按钮,这很简单,但是该图像是一个可编辑的图标,因此我希望每次启动表单时都更新按钮上的图像,该怎么办?
I’m trying to make a button that displays an image, that’s easy, but the image is an editable icon so I want the image on the button to be updated every time the form is started how can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您正在使用 WinForms 并将编辑后的图标保存到文件中。
看看这个 MSDN
ButtonBase.Image
属性上的页面。从上面的链接:
您可以将其放在“新子例程”中的“InitializeComponent 语句”之后。或在您的表单加载事件中。
I am making the assumption that you are using WinForms and saving your editied icon to a file.
Take a look at this MSDN page on
ButtonBase.Image
Property.From above link:
You can put this in the New Subroutine after the InitializeComponent Statement. or in your Form Load event.
使用
Graphics
方法并处理Button的Paint
事件。您可以在图像或按钮区域添加文本和原始绘图。Use
Graphics
method and also handle thePaint
event of Button. You can add text and primitive drawing on Image or Button region.