Home All Groups Group Topic Archive Search About

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

Author
6 Sep 2006 6:01 PM
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

Author
6 Sep 2006 7:46 PM
Mattias Sjögren
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 Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
6 Sep 2006 8:36 PM
Herfried K. Wagner [MVP]
Mattias,

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> schrieb:
>>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.

.... or alternatively use a namespace alias:

\\\
Imports WinForms = System.Windows.Forms
....
If Foo.ShowDialog() = WinForms.DialogResult.OK Then
    ...
End If
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
7 Sep 2006 3:09 PM
Jeffrey Grantz
Thanks. That did it. I changed the line to -

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

Which works fine. Thanks again.

Show quoteHide quote
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:%23AhM40e0GHA.5048@TK2MSFTNGP05.phx.gbl...
> 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 Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.