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

warning on accessing shared method

Why do I get a warning:
Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated

When accessing a shared method in the framework. (for example)
If Control.MouseButtons = MouseButtons.None Then....

What is the point of includes if they don't prevent this type of warning?
Will I always need to explicitly specify the name space?
If Control.MouseButtons = Windows.Forms.MouseButtons.None Then .....
Thanks for any insight into this!
Jul 25 '06 #1
1 1299
iamahulk <ia******@discussions.microsoft.comwrote:
Why do I get a warning:
Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated

When accessing a shared method in the framework. (for example)
If Control.MouseButtons = MouseButtons.None Then....

What is the point of includes if they don't prevent this type of warning?
Will I always need to explicitly specify the name space?
If Control.MouseButtons = Windows.Forms.MouseButtons.None Then .....
This is only because MouseButtons is the name of a property as well as
a type. If MouseButtons weren't a property in the current class you're
writing the code in, it would be absolutely fine. For instance, you
could write the above in a class which didn't derive from anything
other System.Object and it would be fine.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jul 25 '06 #2

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

Similar topics

8
by: Mike Caputo | last post by:
In VB.NET, need to be able to access certain properties on my main form from other forms. These are properties that may be changed by the user, so I have to be able to get to them throughout the...
9
by: Bob Day | last post by:
VS 2003, vb.net , sql msde... I have an application with multiple threads running. Its a telephony application where each thread represents a telephone line. For code that would be the same...
0
by: Rob R. Ainscough | last post by:
When I run my Test application I get the following error: Warning: The dependency 'MyCompany.Utilities, Version=1.0.1852.27525, Culture=neutral' in project 'MyCompany.Remote' cannot be copied to...
5
by: Khalique | last post by:
Hi everyone, I Hope that someone will be able to give me a hint to the solution to my problem. I have developed a web service (vb.net) that needs to access the folders / files and copy files to...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
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...
2
by: AZNewsh | last post by:
Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Here is the line that apparently causes it: ...
2
by: BBM | last post by:
I may be putting too fine a point on this, but I'd like to be able to know the class name of a shared method from within the method. BTW, the shared method is in a "MustInherit" class. So it...
2
by: Brian | last post by:
Hi, No matter how i do this, I get the same warning. I don't understand the warning.... Dim FILETYPE as string() = {"tree;.tree;*.tree"} for x as integer = 0 to ubound(FILETYPE) Orginal...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.