Forum  Core :: SDK (Vi...   How do I...?  BackgroundImage
Previous Previous
 
Next Next
New Post 9/24/2008 8:02 PM
  mattmichler
6 posts
No Ranking


BackgroundImage 
How do I use the BackgroundImage property of the controls? The ultimate goal is to upload an Image and set it as the background of the Form. I already wrote the code to upload an image and convert it to an Image object, but I can't figure out how I'm supposed to set the BackgroundImage property now.
 
New Post 9/24/2008 9:12 PM
  mattmichler
6 posts
No Ranking


Re: BackgroundImage 
I figured out how to create a ResourceHandle object from the file and I even tried setting the BackgroundImage property of the Form to the instance of the ResourceHandle but that didn't work either. I'm wondering if maybe I'm supposed to notify the Form to update the background Image after its been set?
 
New Post 9/25/2008 10:01 AM
  ori.cohen
4383 posts
1st Level Poster




Re: BackgroundImage 
Modified By host  on 9/25/2008 12:02:54 PM)
Hello,

Welcome to Visual WebGui!

To use an image in VWG, you need to first create a "Resources" folder under the project folder. Inside that folder, create an "Images" folder and place your image/s in this folder. These folders must be included in your project.
Open the Web.config file and make sure you have the following XML element inside the "Directories" section:
<Directory Code="Images"  Path="Resources\images" />
If it is not there, add it.

With this done, all you'll need to do is create a new ImageResourceHandle and send to the constructor, the exact name of the image file (with the correct casing).
If you want to set the BackgroundImage property of a control, all you'll need to do is to initialize it with such an ImageResourceHandle object.

Regards,

Ori Cohen
The Visual WebGui team

 
New Post 9/25/2008 11:49 AM
  mattmichler
6 posts
No Ranking


Re: BackgroundImage 
Well, I got this to work properly for PictureBox.Image but not a Form.BackgroundImage. I can set the background image of the form manually in the properties but doing it dynamically does not load.
 
New Post 9/28/2008 6:21 AM
  izi.versano
191 posts
5th Level Poster




Re: BackgroundImage 
Hello,

By dynamically what exactly do you mean?
 can you send code sample or sample application  so i can reproduce the scenario .

Regards,

Izi Versano
The Visual WebGui team

 
Previous Previous
 
Next Next
  Forum  Core :: SDK (Vi...   How do I...?  BackgroundImage
Azure banner
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS