Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2007, 08:20 AM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default UserControl Color Management

I have a user control (Call it MainControl) that incorporates a few user drawn controls. Amongst these user drawn controls I have several instances of a CustomTabPage. I have a static property TabPageBackColor in the MainControl. The purpose of the property is to set the background color of all tab pages in the MainControl. Everything works fine but if I have two instances of the MainControl in a form then setting instance1 TabPageBackColor to red also effects the instance2 (because of the property being static).

How can I set up the property so that it is
1) Non-static
2) Changes the color of the custom tabpage

Note that the custom tab page is user drawn i.e the backcolor is actually painted in the OnPaint method.

Thanks,
Hamid





Similar Threads
Thread Thread Starter Forum Replies Last Post
usercontrol and javascript Hanch ASP.NET 2.0 Basics 1 March 7th, 2007 08:38 AM
Get value of a QueryStringParameter in UserControl hpox ASP.NET 2.0 Basics 1 February 16th, 2007 11:54 AM
Refresh UserControl jpfree71 ASP.NET 1.0 and 1.1 Basics 3 August 17th, 2004 12:31 PM
a usercontrol problem csc820203 C# 2 July 10th, 2004 10:55 AM
Intellisense for UserControl RNedel ASP.NET 1.0 and 1.1 Basics 6 June 15th, 2004 04:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.