开发者

icon as an image

开发者 https://www.devze.com 2023-01-04 00:26 出处:网络
is it possible to use icon file as a image for a button in visual basic? f.e. I have 3 buttons that need to have 3 icons when you click the button the icon of the button needs to be the icon of the fo

is it possible to use icon file as a image for a button in visual basic?

f.e. I have 3 buttons that need to have 3 icons when you click the button the icon of the button needs to be the icon of the form is this posible?

btnIcon1 = my.开发者_StackOverflow中文版resources.ICO1

btnIcon2 = my.resources.ICO2


The most basic method to do that:

myButton.Image = Me.Icon.ToBitmap

You can also use:

myButton.Image = My.Resources.myIcon.ToBitmap

Both of these methods extract and use the 32x32 icon from the .ico file.

0

精彩评论

暂无评论...
验证码 换一张
取 消