|
-
Dec 12th, 2003, 05:35 AM
#1
Thread Starter
Fanatic Member
Open File Dialogue problem
I use the following code to open a dialogue box. The user chooses a file and that image file is used as the source for the picturebox control :
Private Sub btnChoose1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChoose1.Click
Dim ofdImage1 As New OpenFileDialog()
ofdImage1.Filter = "Picture Files|*.bmp;*.jpg;*.jpeg;*.gif;*.ico"
ofdImage1.ShowDialog()
If (ofdImage1.ShowDialog() = DialogResult.OK) Then
Me.picImage1.Image = New Bitmap(ofdImage1.FileName)
End If
End Sub
The problem is that if I choose from the file dialogue box, or hit cancel, the dialogue box appears a second time.
I dont understand.
Any ideas folks ?
TIA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|