|Fantastic, I'd never used a breakpoint before but it really did the trick.|
I identified that somehow setting the Result variable to 'OpenFD.ShowDialog()' somehow meant that the dialog was called... I solved this by removing the variable and using DialogResult in my If statement instead of the Result variable.
One more thing you could help me with: when i open my windows explorer from the Open Button in my script, it defults to 'OpenFileDialog1'. Even when i click the cancel button my text box opens and has the text 'OpenFileDialog1', it should return 'You clicked cancel'.
Do you know why?
I include a revised version of my script:
Private Sub MSFOpen_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Dim FileTitle As String
OpenFD.InitialDirectory = "C:\Users"
OpenFD.Title = "Which File Do You Want To Open?"
OpenFD.Filter = "TextFile|*.txt"
FileTitle = OpenFD.FileName
If DialogResult = DialogResult.Cancel Then
MsgBox("You Clicked Cancel")
Else : MsgBox(FileTitle)
Thanks for you help so far