I know this one from a user group meeting the other night.
Application.EnableVisualStyles() is the C# 2005 way of telling your app to use XP themes. In VB there's a checkbox on the properties page of the project to enable the same. It's done this way with several properties. Splash screen is another. There's a third, but I forget what it was.
>
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?
(On an infant's shirt): Already smarter than Bush