Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error.
Weird resource not delcared error. Weird resource not delcared error.
Weird resource not delcared error.
Go Back  Xtreme Visual Basic Talk > > > Weird resource not delcared error.


Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2011, 03:23 AM
45minutes 45minutes is offline
Regular
 
Join Date: Jan 2011
Posts: 75
Default Weird resource not delcared error.


I have come across this problem several times and do not know what is causing it. It's imported and everything. It just doesn't seem to pick it up. My next best bet is something to do with the 'protection level' how do I go about changing it's protection level. I have searched in P2_Gameover properties for it, but do not know what I'm looking for, specifically. Whenever I get this error, I usually just re-import through a picturebox (that's the only way it seems to work) But please, what am I doing wrong?

Picture displaying this error:
Attached Images
File Type: png hgg5f.png (130.3 KB, 4 views)

Last edited by Flyguy; 06-20-2011 at 06:23 AM. Reason: Don't use external websites for hosting images, just attach them to your post
Reply With Quote
  #2  
Old 06-19-2011, 09:07 AM
Qua's Avatar
QuaWeird resource not delcared error. Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

The problem is that the variable you're trying to access is inaccessible

All variables, methods and classes comes with an access level. This determines which members that can access it. For example, a member could have access level 'Private' which would mean that only other members within the same class could access it. The issue here properly is that the variable you're trying to access is set as private, and then you're trying to access it from another class.

To solve it, change the access level of the variable or create a method/property that exposes the variable.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #3  
Old 06-20-2011, 12:39 AM
45minutes 45minutes is offline
Regular
 
Join Date: Jan 2011
Posts: 75
Default

I have re-imported it and set it to public as it's access modifier. It still doesn't pick it up in the code.
Reply With Quote
  #4  
Old 06-20-2011, 04:11 AM
TRSDOSBasic79's Avatar
TRSDOSBasic79 TRSDOSBasic79 is offline
Contributor
 
Join Date: Oct 2003
Location: Pennsylvania
Posts: 422
Default

Put the mouse over the red underline and intellisense will show you a red dot. Click the dot and sometimes intellisense will show you a solution or some options.
Reply With Quote
  #5  
Old 06-20-2011, 07:51 AM
DrPunk's Avatar
DrPunkWeird resource not delcared error. DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

Err, what you seem to be doing wrong is importing an image into your project and thinking you can use the image like a form or something.

Firstly, you should really add images as resources because it makes getting them out of the project easier. There are various ways of getting to the resources, one of which is to open up "My Project" and go to the resources page. Use the "Add Resource..." "Add existing file..." to add your images. It'll default to the name of the image file but you can call it whatever you want once it's imported.

Now it's in the resources we can get to the image using...
Code:
My.Resources.[NameOfTheResource]
But that still doesn't give you a Show method. Images don't have show methods. You have to draw the image somewhere. Like setting the Image property of a picturebox...
Code:
PictureBox1.Image = My.Resources.[NameOfTheResource]
__________________
There are no computers in heaven!
Reply With Quote
  #6  
Old 06-20-2011, 11:11 PM
45minutes 45minutes is offline
Regular
 
Join Date: Jan 2011
Posts: 75
Default

Quote:
Originally Posted by DrPunk View Post
Err, what you seem to be doing wrong is importing an image into your project and thinking you can use the image like a form or something.

Firstly, you should really add images as resources because it makes getting them out of the project easier. There are various ways of getting to the resources, one of which is to open up "My Project" and go to the resources page. Use the "Add Resource..." "Add existing file..." to add your images. It'll default to the name of the image file but you can call it whatever you want once it's imported.

Now it's in the resources we can get to the image using...
Code:
My.Resources.[NameOfTheResource]
But that still doesn't give you a Show method. Images don't have show methods. You have to draw the image somewhere. Like setting the Image property of a picturebox...
Code:
PictureBox1.Image = My.Resources.[NameOfTheResource]
Hmmm very weird, I did it this way before. Still same error. I initially had another image and used .show and it worked :/ I will give it another try.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error. Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error. Weird resource not delcared error.
Weird resource not delcared error.
Weird resource not delcared error.
 
Weird resource not delcared error.
Weird resource not delcared error.
 
-->