473,396 Members | 1,775 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,396 software developers and data experts.

2005 error

cj
The below line gives me an error on DialogResult.No saying: "Access of
shared member, constant member, enum member or nested type through an
instance; qualifying expression will not be evaluated." It didn't give
me that in 2003. What does that mean?

If MessageBox.Show("Copy from " & fromDir & " to " & toDir & " ?", "",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
Apr 2 '07 #1
5 933
HI CJ
Can you post the declarations for fromDir and toDir?
Regards
Parag

"cj" <cj@nospam.nospamwrote in message
news:uz**************@TK2MSFTNGP05.phx.gbl...
The below line gives me an error on DialogResult.No saying: "Access of
shared member, constant member, enum member or nested type through an
instance; qualifying expression will not be evaluated." It didn't give me
that in 2003. What does that mean?

If MessageBox.Show("Copy from " & fromDir & " to " & toDir & " ?", "",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then

Apr 2 '07 #2
cj,

When you use DialogResult.No you are referencing the form's DialogResult
property, which is an instance of the DialogResult class.

Instead, use Windows.Forms.DialogResult.No to access the shared member.

Kerry Moorman
"cj" wrote:
The below line gives me an error on DialogResult.No saying: "Access of
shared member, constant member, enum member or nested type through an
instance; qualifying expression will not be evaluated." It didn't give
me that in 2003. What does that mean?

If MessageBox.Show("Copy from " & fromDir & " to " & toDir & " ?", "",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
Apr 2 '07 #3
Instead of typing DialogResult.No, type the fully qualified Shared
property:

System.Windows.Forms.DialogResult.No

===================
Clay Burch
Syncfusion, Inc.

Apr 2 '07 #4
"cj" <cj@nospam.nospamschrieb:
The below line gives me an error on DialogResult.No saying: "Access of
shared member, constant member, enum member or nested type through an
instance; qualifying expression will not be evaluated." It didn't give
me that in 2003. What does that mean?

If MessageBox.Show("Copy from " & fromDir & " to " & toDir & " ?", "",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
There is a name clash between the form's 'DialogResult' property and the
'DialogResult' type, and the compiler will bind to the property instead of
the type. To solve the problem, qualify the type name:

\\\
If d.ShowDialog() = System.Windows.Forms.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/>
Apr 2 '07 #5
Hi Cj,

I performed a test based on your sample code but didn't reproduce the
problem on my side.

The namespace "System.Windows.Forms" is imported automatically in WinForms
application projects. In my test project, it's same whether I add the
namespace to the expression 'DialogResult.No' (i.e.
System.Windows.Forms.DialogResult.No) or not.

But you may have a try adding the namespace to the 'DialogResult.No' to see
if the problem still exists.

If the problem still exists, you may send me a sample project that could
just reproduce the problem. To get my actual email address, remove "online"
from my displayed email address.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 3 '07 #6

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

Similar topics

6
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject...
2
by: bcox | last post by:
Hello VS 2005 World... I am making my way through VS 2005 Beta 1 and I'm having a problem getting ASP.NET project to start in IIS running on an XP development machine. I build a sample project...
1
by: QLD_AU | last post by:
Has anyone see the following error ? VS 2005 Installs ok, however the SQL Mobile Edition (part of a full install) fails with the following error ? With Thanks Jason
27
by: Rene | last post by:
I keep getting the following error every time I compile the solution under VS 2005: ---------------- Error 5 Unable to copy file "obj\Debug\xyz.dll" to "bin\Debug\xyz.dll". The process...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
3
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual...
0
by: silviu | last post by:
Hello I'm trying to install Microsoft SQL 2005 Server Express Edition but I'm getting the following error: SQL Server Setup unexpectedly failed... Then it says something about a log file. Here's...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.