Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-set-the-background-of-a-windows-forms-panel-using-the-designer.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.5 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
Set the Background of a Panel Using the Designer 03/30/2017
background colors [Windows Forms], Windows Forms Panel controls
background images [Windows Forms], Windows Forms Panel controls
Panel control [Windows Forms], background
colors [Windows Forms], Windows Forms Panel controls
db83cf54-3c69-4b08-ac6c-25b9b5abb1b0

How to: Set the background of a Windows Forms panel using the Designer

A Windows Forms xref:System.Windows.Forms.Panel control can display both a background color and a background image. The xref:System.Windows.Forms.Control.BackColor%2A property sets the background color for controls that are contained in the panel, such as labels and radio buttons. If the xref:System.Windows.Forms.Control.BackgroundImage%2A property is not set, the xref:System.Windows.Forms.Control.BackColor%2A selection will fill all of the panel. If the xref:System.Windows.Forms.Control.BackgroundImage%2A property is set, the image will be displayed behind the controls that are contained in the panel.

The following procedure requires a Windows Application project with a form that contains a xref:System.Windows.Forms.Panel control. For information about how to set up such a project in Visual Studio, see How to: Create a Windows Forms application project and How to: Add Controls to Windows Forms.

Set the background in the Windows Forms Designer

  1. Open the project in Visual Studio and select the xref:System.Windows.Forms.Panel control.

  2. In the Properties window, click the arrow button next to the xref:System.Windows.Forms.Control.BackColor%2A property to display a window with three tabs.

  3. Select the Custom tab to display a palette of colors.

  4. Select the Web or System tab to display a list of predefined names for colors, and then select a color.

  5. In the Properties window, click the arrow button next to the xref:System.Windows.Forms.Control.BackgroundImage%2A property.

  6. In the Open dialog box, select the file that you want to display.

See also