使用openfiledialog和picturebox

Public Class Form1

    
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
            PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
            PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
            RadioButton1.Checked = False
            PictureBox1.Visible = True
        End If
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        PictureBox1.Visible = False
    End Sub
End Class
文章標籤
全站熱搜
創作者介紹
創作者 Jarvis 的頭像
Jarvis

Jarvis Blog

Jarvis 發表在 痞客邦 留言(0) 人氣(83)