954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to set background image

Hello All
I just made a simple media player in c sharp.My code is

axWindowsMediaPlayer1.ContainingControl.BackgroundImage = Properties.Resources.Image1 ;

But it is not working..................Please tell me.
Thanks Advance

yousafc#
Junior Poster in Training
82 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1
 

You can use "this" keyword to set the background image property.
this means the form you currently are.

this.BackgroundImage = "your image";
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
 

If you want to set the image on some other form, its not good to set it from some other form (over classes). Better to create a new instance of that form, and while in Constructor set it there, using my upper code.

Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
 

But Mitja I want set back ground image of media player not a form

yousafc#
Junior Poster in Training
82 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1
 

"axWindowsMediaPlayer1.ContainingControl.BackgroundImage" is the background of the container of the MediaPlayer object!
I am not sure that you can do what you want with the MediaPlayer SDK.

This link shows why I think this.
All the background changers are modifying the registry!

nick.crane
Nearly a Posting Virtuoso
1,230 posts since Feb 2010
Reputation Points: 375
Solved Threads: 187
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: