Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/how-to-override-the-panel-onrender-method.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.6 KiB

title, ms.date, dev_langs, f1_keywords, helpviewer_keywords, ms.assetid
title ms.date dev_langs f1_keywords helpviewer_keywords ms.assetid
How to: Override the Panel OnRender Method 03/30/2017
csharp
vb
overriding OnRender method
Panel control, overriding OnRender method
OnRender method
controls, Panel, overriding OnRender method
overriding OnRender method of Panel control [WPF]
OnRender method [WPF], overriding
Panel control [WPF], overriding OnRender method
57397834-a085-4e36-90ab-416fad98f341

How to: Override the Panel OnRender Method

This example shows how to override the xref:System.Windows.Controls.Panel.OnRender%2A method of xref:System.Windows.Controls.Panel in order to add custom graphical effects to a layout element.

Example

Use the xref:System.Windows.Controls.Panel.OnRender%2A method in order to add graphical effects to a rendered panel element. For example, you can use this method to add custom border or background effects. A xref:System.Windows.Media.DrawingContext object is passed as an argument, which provides methods for drawing shapes, text, images, or videos. As a result, this method is useful for customization of a panel object.

[!code-csharpLightWeightCustomPanel#1] [!code-vbLightWeightCustomPanel#1]

See also