[VB.net]簡易圖片匯入窗體

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_42008031/article/details/86537848

嘗試利用Vb.net撰寫一個簡易圖片匯入窗體程序,摘要記錄如下:

1.窗體引入OpenFileDialog,使可開啟路徑視窗並選擇欲匯入的圖片。

2.程式碼如下列所示。

Public Class Form1
    Private Sub Bt1_Click(sender As Object, e As EventArgs) Handles Bt1.Click
        Dim result As DialogResult = OpenFileDialog1.ShowDialog
        If result = DialogResult.OK Then
            TB1.Text = OpenFileDialog1.FileName
            PictureBox1.ImageLocation = TB1.Text
        End If

    End Sub
End Class

-----如果文章對您有幫助,打開微信掃一掃,請作者喝杯咖啡。-----

猜你喜欢

转载自blog.csdn.net/weixin_42008031/article/details/86537848