Solved

How to test if the picture box is visible and change the color in VC#

Posted on 2011-03-20
5
340 Views
Last Modified: 2012-05-11
Want to achieve the goal:
if the picture box is visible, want to change the control background color. Which two methods can I use to do that? I could not find IsVisible method. Does it offer it? How to cope with it?
0
Comment
Question by:jl66
5 Comments
 
LVL 6

Accepted Solution

by:
nandithaa earned 500 total points
ID: 35178197
Check if this helps
if (pictureBox1.Visible)
            {
                pictureBox1.BackColor = Color.Blue; 
            }

Open in new window

0
 
LVL 8

Expert Comment

by:jimsweb
ID: 35178244
You can rewrite it like this.

if (pictureBox1.Visible = false)
            {
                pictureBox1.BackColor = Color.Blue;
            }
0
 
LVL 2

Expert Comment

by:ramkihardy
ID: 35178339
Using this you can ACHIEVE THIS

if (pictureBox1.Visible)
            {
                pictureBox1.BackColor = Color.Blue;
            }
else
{
 pictureBox1.BackColor = Color.Blue;
Ask if you want any further help..
Regards
Ramki
}
0
 
LVL 2

Expert Comment

by:ramkihardy
ID: 35178348
Sorry for the above comment...mis typed it
Using this you can ACHIEVE THIS

if (pictureBox1.Visible)
            {
                pictureBox1.BackColor = Color.Blue;
            }
else
{
 pictureBox1.BackColor = Color.white;
}


Regrds Ramki
0
 

Author Closing Comment

by:jl66
ID: 35178381
Thank you so much.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now