Access of shared member, constant member, enum member or nested type through an instance

  • Thread starter Thread starter Jeffrey Grantz
  • Start date Start date
J

Jeffrey Grantz

I took the code below from an example of FolderBrowserDialog but I keep
getting the subject diagnostic on DialogResult.OK and I can't figure out
what I am doing wrong.



Any Help? ADVthanksANCE



Private Sub BTN_Browse_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Browse.Click

Dim sMyPath As String



FolderBrowserDialog1.ShowDialog()

If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
 
Jeffrey,
I took the code below from an example of FolderBrowserDialog but I keep
getting the subject diagnostic on DialogResult.OK and I can't figure out
what I am doing wrong.

I think it's because the name "DialogResult" resolves to the form's
DialogResult property (which returns an instance) rather than the
System.Windows.Forms.DialogResult type. Try to fully qualify the type
name.


Mattias
 
Mattias,

Mattias Sjögren said:
I think it's because the name "DialogResult" resolves to the form's
DialogResult property (which returns an instance) rather than the
System.Windows.Forms.DialogResult type. Try to fully qualify the type
name.

.... or alternatively use a namespace alias:

\\\
Imports WinForms = System.Windows.Forms
....
If Foo.ShowDialog() = WinForms.DialogResult.OK Then
...
End If
///
 
Thanks. That did it. I changed the line to -

If FolderBrowserDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK
Then

Which works fine. Thanks again.
 
Back
Top