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 5964141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:22:41+00:00 2026-05-22T19:22:41+00:00

I have a form that has some controls on itself(btnCreateReport,pnlDarkLayer).I have a panel that

  • 0

I have a form that has some controls on itself(btnCreateReport,pnlDarkLayer).I have a panel that fit to form(Dock = Fill) and it is on the back of all controls.when user click on the btnCreateReport button ,I call pnlDarkLayer BringToFront method and after some calculation I call SendToBack() method of the button.I want to draw a dark layer on form controls and disable all of controls on the form.
Is it possible? Thanks.

Maybe this code help u to understand my purpose:

private void btnCreateReport_Click(object sender, EventArgs e)
{
    pnlDarkLayer.BackColor = Color.FromArgb(100, Color.Gray);         

    pnlDarkLayer.BringToFront();
    btnCreateReport.Enabled = false;

    Thread ProcessReport = new Thread(new ThreadStart(ProcessingReport));
    ProcessReport.Start();
    while (ProcessReport.IsAlive)
    {
        Application.DoEvents();
    }
    pnlDarkLayer.SendToBack();

    btnCreateReport.Enabled = true;

}

This code hide all of controls but i don’t want to hide controls on the form.I want to draw a dark layer on them.And User must can see controls.
I need something like opacity property of forms for their controls.

I have test this:

pnlDarkLayer.CreateGraphics().CompositingMode=System.Drawing.Drawing2D.CompositingMode.SourceOver;

Update: I have test this one: (use a form instead of panel)

private void btnCreateReport_Click(object sender, EventArgs e)
{          

    btnCreateReport.Enabled = false;

    frmProgress ProgressForm = new frmProgress();
    ProgressForm.TopLevel = false;
    ProgressForm.Parent = this;
    ProgressForm.BringToFront();
    this.Controls.Add(ProgressForm);
    ProgressForm.Show();

    Thread ProcessReport = new Thread(new ThreadStart(ProcessingReport));
    ProcessReport.Start();

    while (ProcessReport.IsAlive)
    {
        Application.DoEvents();
    }
    ProgressForm.Close();
    btnCreateReport.Enabled = true;

}

But I can’t see the ProgressForm in my form.

  • 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-05-22T19:22:42+00:00Added an answer on May 22, 2026 at 7:22 pm

    From http://support.microsoft.com/kb/943454

    Transparent controls in WinForms are
    transparent relative to their parent,
    not to other controls. Transparency in
    WinForms is more akin to camouflage
    than true transparency. A transparent
    control doesn’t actually let you see
    the control behind it through the
    form. It asks its parent to draw its
    own background on the “transparent”
    control. This is why a transparent
    control shows the form behind it, but
    covers up any other controls.

    To implement transparency relative to
    other controls requires doing the same
    thing but on a larger scale: instead
    of just asking the parent to draw on
    the foreground control’s background,
    the control needs to ask all controls
    behind it to draw on its background.
    This will only work for controls which
    provide some method to request that
    they be drawn and will not
    automatically update when the
    background control’s image changes.

    The page also provides a code example (in vb, sadly) to show how this is done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Form that has a panel with some textBoxes and checkBox that
I have a form that has a series of check boxes and some line
I have an Access form where each record has some info that is computed
I have a very simple XAML form, that has one namespace definition. For some
I have a form that has a few similar controls and the parent contains
I have a form that is has many controls databound to a object with
I have a very weird issue. I have a UserControl that has some controls
I have a form that has multiple fields, and for testing purposes is there
I have a form that has a public property public bool cancelSearch = false;
I have a form that has a group of 3 text_fields. I need two

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.