?
Solved

Hide background Image

Posted on 2007-10-15
5
Medium Priority
?
1,750 Views
Last Modified: 2008-01-09
Hi Experts,

I have an option group with a background image, how do I hide the image if option 1 is selected and show the image if option 2 is selected?

Thanks again,
Joe
0
Comment
Question by:JoeBo747
5 Comments
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 400 total points
ID: 20076915
?

if (Option1.Value = true) then
Image1.Visible = false
elseif (Option2.Value = true) then
Image1.Visible = true
end if
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 20076931
Hi EDDYKT,

Thanks for your response, the image is a background image on the groupbox control and does not expose a visible property!

Me.GroupBox1.BackgroundImage.visible

I have tried dispose but this throws an error. The image is in the project resources folder.

Thanks again,
Joe
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 400 total points
ID: 20077260
You are going to have to keep an image in memory, and then set the BackGroundImage to Nothing, and reset the BackGroundImage back to the image.

Bob
0
 
LVL 2

Accepted Solution

by:
CuSo4 earned 600 total points
ID: 20077265
Hi,

Try this:

Dim img As Image = New Bitmap("option1.bmp")
If (Option1.Value = true) Then
          GroupBox1.BackgroundImage = img
Else
          GroupBox1.BackgroundImage = Nothing
End If
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 20077337
Hi  CuSo4, TheLearnedOne, EDDYKT,

All three of you have supplied helpful input, thank you; I have added extra points to try and reflect this and split them between you.

Thanks again,
Joe
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question