Solved

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

Posted on 2011-03-20
5
349 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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