Click here to Skip to main content
15,881,620 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code to print in VB.net. I don't have any problem with the printing as it works, but there is a part which is underlined by green, a warning on "DialogResult = OK".


Why the DialogResult = OK is underlined by green colour? The printing work only this underline is making me puzzled

The warning is: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
Posted
Updated 26-Apr-11 23:25pm
v5

Rebuild your app: it should go away.
If it doesn't then look at the error list pane: you should have a message that refers to it under "Warnings"
 
Share this answer
 
Comments
555336 27-Apr-11 5:12am    
Read the warning it is giving me in the question below.
OriginalGriff 27-Apr-11 5:22am    
Wayne is correct - it is a qualification problem: The compiler cannot tell if you mean "System.Windows.Forms.DialogResult" or "Me.DialogResult".
Never seen it complain like that before though...
555336 27-Apr-11 5:27am    
Yes I included it and the warning disappeared. thank you.
Try using the Fully Qualified Name ie

System.Windows.Forms.DialogResult.OK as your Form also has a DialogResult property

This should help
 
Share this answer
 
v2
Comments
OriginalGriff 27-Apr-11 5:23am    
Well spotted! :thumbsup: and 5
Wayne Gaylard 27-Apr-11 5:27am    
Ta!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900