PC Review


Reply
Thread Tools Rate Thread

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

 
 
Jeffrey Grantz
Guest
Posts: n/a
 
      6th Sep 2006
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


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      6th Sep 2006
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.
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      6th Sep 2006
Mattias,

"Mattias Sjögren" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
Jeffrey Grantz
Guest
Posts: n/a
 
      7th Sep 2006
Thanks. That did it. I changed the line to -

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

Which works fine. Thanks again.

"Mattias Sjögren" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access of shared member, constant member, etc. warning William O''Connor Microsoft VB .NET 4 18th Feb 2009 05:26 PM
Would a string instance become a value type if it was a member of astruct? Sathyaish Microsoft C# .NET 3 18th Dec 2008 02:18 AM
how to know an int is the member of an enum type?(C++/CLI) Tau Microsoft VC .NET 9 20th Jan 2006 01:20 AM
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. DJ Dev Microsoft ASP .NET 3 8th Feb 2004 04:19 PM
struct member initialization - member by member?! emma middlebrook Microsoft C# .NET 10 28th Jul 2003 08:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 PM.