OpenFileDialog Shows Twice?
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
Hello,
I am using the following code from what I assume is correct.
I am using the following code from what I assume is correct.
Code: Select all
I have this problem: After you select a file and click open, it shows the dialog again. Then, you select it again and click open, and it works. Can somebody tell me why this happens? And how to fix it? OpenFileDialog1.ShowDialog()
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim Reader As New System.IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = Reader.ReadToEnd
End If
The reason for this is because ShowDialog is being called twice.
Get rid of the first line to solve this problem.
Get rid of the first line to solve this problem.
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023