Click here to Skip to main content
15,898,981 members
Home / Discussions / C#
   

C#

 
QuestionC# files missing .cs file Pin
Member 906602516-Jul-12 20:33
Member 906602516-Jul-12 20:33 
GeneralRe: C# files missing .cs file Pin
Sandeep Mewara16-Jul-12 21:11
mveSandeep Mewara16-Jul-12 21:11 
GeneralRe: C# files missing .cs file Pin
Member 906602516-Jul-12 22:44
Member 906602516-Jul-12 22:44 
AnswerRe: C# files missing .cs file Pin
Sandeep Mewara16-Jul-12 23:39
mveSandeep Mewara16-Jul-12 23:39 
GeneralRe: C# files missing .cs file Pin
Member 906602517-Jul-12 0:49
Member 906602517-Jul-12 0:49 
GeneralRe: C# files missing .cs file Pin
Pete O'Hanlon17-Jul-12 1:19
mvePete O'Hanlon17-Jul-12 1:19 
GeneralRe: C# files missing .cs file Pin
Member 906602517-Jul-12 3:51
Member 906602517-Jul-12 3:51 
GeneralRe: C# files missing .cs file Pin
Pete O'Hanlon17-Jul-12 3:52
mvePete O'Hanlon17-Jul-12 3:52 
GeneralRe: C# files missing .cs file Pin
Member 906602517-Jul-12 20:07
Member 906602517-Jul-12 20:07 
GeneralRe: C# files missing .cs file Pin
Member 906602517-Jul-12 21:54
Member 906602517-Jul-12 21:54 
GeneralRe: C# files missing .cs file Pin
Pete O'Hanlon17-Jul-12 22:58
mvePete O'Hanlon17-Jul-12 22:58 
GeneralRe: C# files missing .cs file Pin
Member 906602518-Jul-12 0:47
Member 906602518-Jul-12 0:47 
GeneralRe: C# files missing .cs file Pin
Pete O'Hanlon18-Jul-12 1:30
mvePete O'Hanlon18-Jul-12 1:30 
GeneralRe: C# files missing .cs file Pin
Member 906602518-Jul-12 2:02
Member 906602518-Jul-12 2:02 
QuestionString to Object Instance Problem Pin
atoi_powered16-Jul-12 14:04
atoi_powered16-Jul-12 14:04 
AnswerRe: String to Object Instance Problem Pin
Wes Aday16-Jul-12 14:45
professionalWes Aday16-Jul-12 14:45 
GeneralRe: String to Object Instance Problem Pin
atoi_powered17-Jul-12 0:40
atoi_powered17-Jul-12 0:40 
AnswerRe: String to Object Instance Problem Pin
Pete O'Hanlon16-Jul-12 20:53
mvePete O'Hanlon16-Jul-12 20:53 
GeneralRe: String to Object Instance Problem Pin
atoi_powered17-Jul-12 0:25
atoi_powered17-Jul-12 0:25 
GeneralRe: String to Object Instance Problem Pin
Pete O'Hanlon17-Jul-12 1:16
mvePete O'Hanlon17-Jul-12 1:16 
Well, the problem in your code is that you are retrieving the type of BackgroundImage - which is Image, and then attempting to cast that into a PictureBox. You can't do this - hence the reason that the value of picture is null. In your sample, you really need to do this:
C#
PictureBox picture = new PictureBox();
picture.BackgroundImage = Resource1.island;
You will also need to place this control on the screen (and add it to the Controls collection of its parent).

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: String to Object Instance Problem Pin
atoi_powered17-Jul-12 1:43
atoi_powered17-Jul-12 1:43 
GeneralRe: String to Object Instance Problem Pin
Pete O'Hanlon17-Jul-12 2:04
mvePete O'Hanlon17-Jul-12 2:04 
GeneralRe: String to Object Instance Problem Pin
atoi_powered17-Jul-12 3:42
atoi_powered17-Jul-12 3:42 
GeneralRe: String to Object Instance Problem Pin
Pete O'Hanlon17-Jul-12 3:50
mvePete O'Hanlon17-Jul-12 3:50 
GeneralRe: String to Object Instance Problem Pin
atoi_powered17-Jul-12 3:57
atoi_powered17-Jul-12 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.