Print Page | Close Window

.NET tab control not skinning properly

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=11655
Printed Date: 27 April 2024 at 5:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: .NET tab control not skinning properly
Posted By: YellowStreak
Subject: .NET tab control not skinning properly
Date Posted: 30 July 2008 at 5:36am
I have a .NET tab control with two tab pages which I am applying the skinframework to.  The skinning works fine when form first opens but when I change tabs - the tab page backcolor (set to btnface) goes white.  Switching back to the previous tab shows that as now being white as well.
 
Any ideas how I can force this backcolor property? 



Replies:
Posted By: Oleg
Date Posted: 30 July 2008 at 8:20am
Hi,
 
You can try trick from our sample:
 
private void tabControl_SelectedIndexChanged(object sender, System.EventArgs e)
  {
   if (tabControl.SelectedIndex == 1)
   {
    skinFramework.ApplyWindow(this.tabPage2.Handle.ToInt32());
    skinFramework.EnableThemeDialogTexture(this.tabPage2.Handle.ToInt32(), 6); 
   }
  }


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: YellowStreak
Date Posted: 30 July 2008 at 9:20am
I'm already doing that.  Before I applied that, things like the radio buttons were not skinning.  Applying that change fixed those issues but the back colour thing just will not go away.


Posted By: YellowStreak
Date Posted: 30 July 2008 at 10:00am
https://forum.codejock.com/uploads/20080730_095904_ColInteropTest.zip - uploads/20080730_095904_ColInteropTest.zip
 
Here is a mini project that shows the issue I'm having.
 
The demo is using VB6 and VS2005 VB.NET
 
You will need to Interop Tool Kit installed and also .NET framework 2.0 service pack 1.
 
Thanks
 


Posted By: Oleg
Date Posted: 31 July 2008 at 3:00am
https://forum.codejock.com/uploads/20080731_030026_c.zip -
Here changes I made
 
uploads/20080731_030026_c.zip


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: YellowStreak
Date Posted: 31 July 2008 at 4:14am
Hi Oleg.  Thanks for the response.
 
I tried your suggested changes but it is still not working.  the tabs backgrounds still just appear as white.  the radio buttons backcolor shows as the correct color I was expecting to see for the tabs.
 
Did you actually get the sample working correctly at your end?


Posted By: Oleg
Date Posted: 31 July 2008 at 4:21am
Hi,
 
Actually white color is background of TabPage.  if you don't need it just don't call EnableThemeDialogTexture.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: YellowStreak
Date Posted: 31 July 2008 at 5:59am

Fantastic! It worked.

I was assuming I had some code missing rather than too much!
 
Thanks very much for your help.


Posted By: YellowStreak
Date Posted: 31 July 2008 at 6:47am
As Ive got your attention I have one last issue that I thought I would sneak into this thread.
 
I am using a FlowLayout Panel that is dynamically populated at runtime with various controls.
 
The only way I could get the dynamically created controls to skin was to loop through them all and apply the skin individually:
 
For Each ctrl as Control in flpFlags.Controls
_frmStyles.SkinFramework.ApplyWindow(ctrl.Handle.ToInt32)
Next
 
This works but is it the best way?  I have other flowlayouts on popup forms that are populated at formLoad and they seem to skin with OK with just form having the skin applied.
 
My only remaining problem is that the list/combo box highlighted row is not picking up the default skin value.
 
e.g if I am on a the blue theme it should be orange but it is still showing in its default Blue.
 
Any ideas?
 


Posted By: Oleg
Date Posted: 01 August 2008 at 3:18am

Hi,

Add manifest for your application and selections will use skinned colors.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: YellowStreak
Date Posted: 01 August 2008 at 5:33am
That did the trick.
 
Thanks again.


Posted By: LordCover
Date Posted: 02 August 2008 at 12:04am
Originally posted by Oleg Oleg wrote:

Add manifest for your application and selections will use skinned colors.
 
And how is that please?
 
I have the same problem.
 
thanks.
 


Posted By: Oleg
Date Posted: 03 August 2008 at 4:36am
In VC2003+ just add
 
static void Main() 
{
  Application.EnableVisualStyles()
  Application.DoEvents();
  Application.Run(new frmMain());
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net