Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TabPage in 2.0
Message
De
09/02/2006 15:46:53
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
01094743
Message ID:
01095243
Vues:
9
Well, I will certainly be curious to know what you find out when you dive back into it. If I get a chance, I may play around with 2.0 a little this weekend.

The whole deal with the Red color of controls is something we only do at runtime to indicate bad user input (it's part of our rule-checking paradigm) ... that's what I thought you were talking about in your first post. I obviously didn't look too closely at your code ... sorry! =( So, no, I haven't changed the BackColor in the sub-classed controls.

~~Bonnie



>I believe so, but I will not know for sure until I test it further. Initially I think it was only the BackColor property I had issues with and from the little looking into it that I did (before I got bothered with something else) I think it only affects Button and TabPage (since it appears that only those 2 controls have a UseVisualStyleBackColor property). But all this being said I need to do some more diving into MSDN docs.
>
>Do you change the BackColor in your subclassed controls?
>
>Einar
>
>>Einar,
>>
>>Does this solve all of the sub-classing issues you were talking about earlier?
>>
>>~~Bonnie
>>
>>
>>>EUREKA!!!!!!!
>>>There is this new control property called UseVisualStyleBackColor that for some reason is True (notice bold). If I set this property to false then things start working just like in 1.1.
>>>
>>>Now I've got got to do some reading about UseVisualStyleBackColor which I *think* is related to Application.EnableVisualStyles(); in Main() by default in VS2005.
>>>
>>>Any thoughts on the issue are always welcome.
>>>
>>>Einar
>>>
>>>>I have subclassed the TabPage control (see code further down). This code worked just fine in VS2003, but in VS2005 it doesn't work as expected (i.e. my tabpages are not red)
>>>>
>>>>OK here is my code for my subclassed tabpage:
>>>>
>>>>using System;
>>>>using System.Collections;
>>>>using System.ComponentModel;
>>>>using System.Drawing;
>>>>using System.Windows.Forms;
>>>>
>>>>namespace WindowsApplication19
>>>>{
>>>>	class myTabPage : System.Windows.Forms.TabPage
>>>>	{
>>>>		private System.ComponentModel.IContainer components = null;
>>>>		
>>>>		public override Color BackColor
>>>>		{
>>>>			get { return base.BackColor; }
>>>>			set { ;	}
>>>>		}
>>>>
>>>>		public myTabPage()
>>>>		{
>>>>			InitializeComponent();
>>>>			base.BackColor = Color.Red;
>>>>		}
>>>>
>>>>		protected override void Dispose( bool disposing )
>>>>		{
>>>>			if( disposing )
>>>>			{
>>>>				if (components != null)
>>>>				{
>>>>					components.Dispose();
>>>>				}
>>>>			}
>>>>			base.Dispose( disposing );
>>>>		}
>>>>
>>>>		private void InitializeComponent()
>>>>		{
>>>>			this.SuspendLayout();
>>>>			this.ResumeLayout(false);
>>>>		}
>>>>	}
>>>>}
>>>>
>>>>
>>>>(someone might feel the need to comment that I should not make the backcolor bright red, but this is simply an example <s>)
>>>>
>>>>Any clue about what I am doing wrong?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform