Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Interface and Graphics > No Background Images


Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2011, 08:38 AM
sirmilt sirmilt is offline
Contributor
 
Join Date: Jan 2003
Location: Florida
Posts: 413
Default No Background Images


I recently upgraded an application I am working on from Visual Basic 2008 Professional to Visual Basic 2010 Ultimate. The application has three windows forms , each with a different background image. The images worked fine in VB 2008 but do not appear in 2010.

I have tried creating a simple, one form , one control application and adding a background and it does not appear. As with my full application the forms properties seem to be correct, I get no errors... but get no background.

Images in specific controls, like the Button or menu items do work fine.

I have run the "repair" installation several times, to no avail. Does anyone have any suggestions?

Milt
Reply With Quote
  #2  
Old 11-18-2011, 10:36 AM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,714
Default

How are you adding the background, i.e. are you setting the Background_Image property in the IDE, or dynamically loading the image at startup.
Is it possible you're overidding the OnPaint event and not calling the default handler before you process the event?
Do you change the style of the window, or set the DoubledBuffered property?

I just opened an existing project, set the BackgroundImage to a jpg file and it shows up in the IDE, and when I run. It tiles by default, and that is working (VS2010 Professional).

If you do the same thing, and the image doesn't show, then I have no idea.
I'm assuming that the image file is not somehow fully transparent so is not showing up for that reason, or that the BackgroundImageLayout is somehow causing a problem.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.

Last edited by passel; 11-18-2011 at 10:44 AM.
Reply With Quote
  #3  
Old 11-18-2011, 04:52 PM
sirmilt sirmilt is offline
Contributor
 
Join Date: Jan 2003
Location: Florida
Posts: 413
Default

Thanks, Passel, for trying to help.

What you described in the third paragraph of your response is exactly what I do.

Milt
Reply With Quote
  #4  
Old 11-19-2011, 11:27 AM
sirmilt sirmilt is offline
Contributor
 
Join Date: Jan 2003
Location: Florida
Posts: 413
Default

After some searching, I found a solution to my problem in the MSDN. This is not as simple as using the forms "Background Image" property but accomplishes the purpose. The link is:

http://msdn.microsoft.com/en-us/libr...oundimage.aspx

the link refers to the Oval Shape, but seems to work equally well with the Rectangle Shape. The only thing to be carefull about is the size of the rectangle compared to the size of the form, and this is only cosmetic.

Milt
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
 
 
-->