Strip menu, show dialog help


I was experimenting with the strip menu in Microsoft visual basic 2008 express edition but experienced a problem when opening a windows explorer window to access files. I was under the impression that to open this i had to use 'OpenFD.ShowDialog()';however when I add this to my code the Dialog (windows explorer window) opens twice... Can you explain why? It appears to open once if i do not add this code, so I cannot understand how the Dialog is opening.... There is a copy of my code included in this post:


Private Sub MSFOpen_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) _

Handles MSFOpen.Click

Dim FileTitle As String

Dim Result

OpenFD.InitialDirectory = "C:Users"

OpenFD.Title = "Which File Do You Want To Open?"

OpenFD.Filter = "TextFile|*.txt"

Result = OpenFD.ShowDialog()

FileTitle = OpenFD.FileName

If Result = DialogResult.Cancel Then

MsgBox("You Clicked Cancel")

Else : MsgBox(FileTitle)

End If

End Sub


Thanks for your help in advance, I am sorry if my problem has not been clear, if I can help by clarifying I would happily do so.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!