-
-
Save JPeroutek/da8c45f10e9bd52411aa to your computer and use it in GitHub Desktop.
openFileDialog 7/1/2014
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub openFileDialog(ByVal sender As System.Windows.Forms.ToolStripMenuItem, ByVal e As System.EventArgs) | |
Dim myOpenFileDialog As New OpenFileDialog() | |
If Not sender.GetCurrentParent().Parent.Text = "" Then | |
myOpenFileDialog.InitialDirectory = sender.GetCurrentParent().Parent.Text | |
Else | |
myOpenFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) | |
End If | |
myOpenFileDialog.Filter = "All files (*.*)|*.*" | |
myOpenFileDialog.FilterIndex = 1 | |
myOpenFileDialog.RestoreDirectory = True | |
If myOpenFileDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then | |
sender.GetCurrentParent().Parent.Text = myOpenFileDialog.FileName | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment