473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

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
Sep 6 '06 #1
3 11149
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.
Sep 6 '06 #2
Mattias,

"Mattias Sjögren" <ma********************@mvps.orgschrieb:
>>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/>

Sep 6 '06 #3
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" <ma********************@mvps.orgwrote in message
news:%2****************@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.

Sep 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Neil Zanella | last post by:
Hello, I have seen code that does the following: enum Letter { X, Y, Z, numLetters }; Is this considered good or bad code? On one hand, the code seems more maintainable because no matter...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
22
by: Ben Finney | last post by:
Howdy all, I've recently packaged 'enum' in PyPI. In its description, I make the claim that it creates "immutable" enumeration objects, and that the enumeration values are "constant" values. ...
5
by: AnDrE | last post by:
Hello I'm developing a application in VB .NET 2005 and I need to access text files. I'm using the System.IO.File library and I have this code: Dim oFile As System.IO.File Dim oRead As...
0
by: gadya | last post by:
"Cursor.Current = Cursors.Default" generates: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. --- Posted via...
5
by: ZikO | last post by:
Hi there. I have a problem. I have created nested classes but don't know how to access to inner classes. I know I can create objects: Hen Object; Hen::Nest ObjectNest; Hen::Nest::Egg...
1
by: Rick | last post by:
I'm in the process of migrating from VS 2003 to VS 2005. One of the compile warnings I am seeing is: "Access of shared member, constant member, enum member or nested type through an instance;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.