Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8468095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:50:14+00:00 2026-06-10T15:50:14+00:00

There are 3 panels pnlPanel0, pnlPanel1, pnlPanel2 with the same size and the same

  • 0

There are 3 panels pnlPanel0, pnlPanel1, pnlPanel2 with the same size and the same position.

With buttons “left” or “right” I need to change visibility of each panel.

With pnlPanel0 (contains labels) and pnlPanel2 (contains buttons) – OK.

But with pnlPanel1 (contains ListView):

curLayer == 1: after pnlPanel1.Visible = true;
panel with ListView is still invisible.

But if pnlPanel1 is not intersected with pnlPanel0 and pnlPanel2 – OK.

Why?

May be in this case is something wrong with “Bring to front”/”Send to back”?

Is there another safe and issue-free solution?

     if (curLayer == 0)
        {
            pnlPanel0.Visible = true;
            pnlPanel1.Visible = false;
            pnlPanel2.Visible = false;
        }
        else if (curLayer == 1)
        {
            pnlPanel0.Visible = false;
            pnlPanel1.Visible = true;
            pnlPanel2.Visible = false;
        }
        else if (curLayer == 2)
        {
            pnlPanel0.Visible = false;
            pnlPanel1.Visible = false;
            pnlPanel2.Visible = true;
        }

        MessageBox.Show(Convert.ToString(pnlPanel1.Visible)); // always false

.NET CF 3.5/WinForms/VS 2008/WinCE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:50:16+00:00Added an answer on June 10, 2026 at 3:50 pm

    I’ve got a form with about 7 Panel controls on it.

    At Form_Load, all Panels are set to .Dock = DockStyle.Fill;.

    Further, all Panels share this same GotFocus event:

    private void ActivePanel_GotFocus(object sender, EventArgs e) {
      Panel pnl = sender as Panel;
      if (pnl != null) {
        pnl.BringToFront();
      }
    }
    

    Do you need to do something with a particular panel? OK, then take a look at this version:

    private void ActivePanel_GotFocus(object sender, EventArgs e) {
      Panel pnl = sender as Panel;
      if (pnl != null) {
        pnl.BringToFront();
        if (pnl.Name == pnlPanel0.Name) {
          // Do something with pnlPanel0
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have in Java two panels which need to have same layout, there is
Seems there no auto size option for Panels in Firefox Add-on SDK extensions, but
In Gui's there are Flow Layout Panels which size the contents of the panel
Is there a hotkey in Firebug to change between the panels, or some way
I have two tab panels, and in each of these there is a user
I have a JFrame with BorderLayout , there are panels on all sides (North,
is there any way to dock two windows(like Winamp does with panels), but one
I have two panels in update panel. In panel1, there is button. If I
I got the requirement like, In a page there will be 4 panels which
I have an asp.net page with three ajax updatepanels. in each panel there are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.