tags:

views:

29

answers:

1

i need some help regarding the following:

HomeArrayPicBox[i, j].Image = (Image)Properties.Resources.ResourceManager.GetObject("Scan" + i);

SoundPlayer fire = new SoundPlayer(Properties.Resources.fire);

for the picbox i can load an image from resources using cast (Image).

i was wondering how to do this for audio i.e. some sort of (Audio)?

is this possible?

+2  A: 

Yes, it's possible. Just use streams:

System.IO.Stream stream = Properties.Resources.ResourceManager.GetStream("resource_name");
System.Media.SoundPlayer player = new System.Media.SoundPlayer(stream);
ILya
super! many thanks.
iEisenhower
You are welcome)
ILya