Windows Develop Bookmark and Share   
 index > Windows Forms General > Gradient Fill in a Panel control
 

Gradient Fill in a Panel control

I can get a gradient fill to work for the form (ClientRectangle) but how do I do this for the background of a panel control object?
MigrationUser 1  Tuesday, July 15, 2003 11:26 PM
Well, the easiest way would be to create a new class, derive it from Panel, override OnPaint and place similar code that you used in the form there.  Another option is, in your form, to handle the Paint Event of the Panel and place your painting code there.
MigrationUser 1  Wednesday, July 16, 2003 10:13 AM
Thanks.

I used the same code for painting the form in the panel_onPaint event handler and referenced the panel1.clientRectangle in the defining the brush

MigrationUser 1  Wednesday, July 16, 2003 12:41 PM

You can use google to search for other answers

Custom Search

More Threads

• What is MSHtmHstInterop.dll ?
• Create event for dynamic create control
• Windows 7 RTM on MSDN
• Copying controls in a tabcontrol using reflection
• Displaying images in a listview columnheader
• Loading a Text File to Crystal Reports through C#.net 2003
• Application Architecture
• Localization through XML files
• Create an Image or Bitmap from an image
• creating dynamic textbox controls with a click of the button