vb.net如何实现用OpenFileDialog选择一个图片做button的icon?
发布网友
发布时间:2022-04-26 19:03
我来回答
共1个回答
热心网友
时间:2023-10-22 14:58
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim ofd As OpenFileDialog
ofd = New OpenFileDialog()
ofd.ShowDialog()
Dim ico As String = ofd.FileName
Button2.BackgroundImage = Image.FromFile(ico)
End Sub