If openFileDialog1.ShowDialog() = DialogResult.OK Then myStream = openFileDialog1.OpenFile() If Not (myStream Is Nothing) Then ' Insert code to read the stream here.
'ラベルへオープン対象のパスをセットしています。 strPath = openFileDialog1.FileName ListBox1.Items.Add(strPath) myStream.Close() End If End If
End Sub
'添付ファイルを削除する Private Sub Button3_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer
If ListBox1.SelectedIndices.Count > 0 Then For i = 0 To ListBox1.SelectedIndices.Count - 1 ListBox1.Items.RemoveAt( _ ListBox1.SelectedIndices.Item(0)) Next End If
End Sub
'フォームロード時 Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = ""