Hi,
I am using a gradient panel control in one of my usercontrols. Along with my user control I have the group bar control with StackedMode=true and VisualStyle to Office2003. I tried to simulate the same gradient colours as in the GroupBar control''s header in my gradient panel. But as we change the Windows XP theme the colours will not match as I am not using Standard System colours.
Please let me know what are the System Colours you used to paint the Header portion of the GroupBar Control, so that I will apply the same for my Gradient Panel Control. Or suggest me a similer control that can be used as a header with the same colour pattern.
Thanks for the help in advance.
Regards
Vijay
GS
Gopalakrishnan S
Syncfusion Team
September 1, 2006 04:55 PM UTC
Hi Vijay,
You can apply same color for both gradient panel and groupbar header, what colors you used in gradient panel , you just given that colors to the Groupbar header.
Here is the code snippet:
Office2003Colors.GroupBarHeaderColorDark = Color.LightSteelBlue;
Office2003Colors.GroupBarHeaderColorLight = Color.Black;
Please refer the attachments and let me know if I have missed anything.
Thank you,
S.Gopal.
Sample.zip
VK
Vijaya Kumar Reddy
September 4, 2006 01:40 PM UTC
Hi,
Please find moe info about the problem in the attached word document.
Hope this will explain more about my problem to make My Gradient Panel to exactly look like the Headerbar in the Groupbar.
Thanks and regards
Vijay
GradientPanel And GroupBar.zip
MJ
Mano J
Syncfusion Team
September 4, 2006 02:15 PM UTC
Hi Vijay,
The following are the colors used in GroupBar header for different XPThemes. You can use the same code in your application after InitializeComponent.
[C#]
if (XPThemes.IsDefaultBlueThemeOn)
this.gradientPanel1.BackgroundColor = new BrushInfo(GradientStyle.Vertical, Color.FromArgb(89, 135, 214), Color.FromArgb(3, 56, 147));
else if(XPThemes.IsSilverThemeOn)
this.gradientPanel1.BackgroundColor = new BrushInfo(GradientStyle.Vertical, Color.FromArgb(179, 178, 200), Color.FromArgb(124, 124, 148));
else if(XPThemes.IsOliveGreenThemeOn)
this.gradientPanel1.BackgroundColor = new BrushInfo(GradientStyle.Vertical, Color.FromArgb(176, 194, 140), Color.FromArgb(96, 128, 88));
Please let me know if this helps.
Thanks,
Mano
VK
Vijaya Kumar Reddy
September 4, 2006 03:28 PM UTC
Hi Mano,
I applied the same colours but not getting the same effect. Please see the attached sample application and let me know if there is any other way or any problem in the code.
Thanks for the help.
Regards
Vijay
WindowsApplication3_1ef406780.zip
MJ
Mano J
Syncfusion Team
September 4, 2006 04:37 PM UTC
Hi Vijay,
The colors work fine in all three themes (Blue, Silver and Olive) in your sample. I have attached the screenshot of my testing.
Could you please provide your machine details and the screenshot which shows the issue after adding the code?
Thanks,
Mano
Snap_1.zip
VK
Vijaya Kumar Reddy
September 4, 2006 04:51 PM UTC
Hi,
I attach the zip file with screenshot.
BTW I am using 3.2.1 version of Syncfusion controls.
I reproduced this screenshot from the same code sample as in the previous post.
Thanks for the hekp
Regards
Vijay
GradientPanel.zip
MJ
Mano J
Syncfusion Team
September 4, 2006 07:32 PM UTC
Hi Vijay,
Please add the previous code in the Form_Paint event instead of Form_Load event.
Regards,
Mano
VK
Vijaya Kumar Reddy
September 5, 2006 04:49 PM UTC
Hi Mano,
It is still the same even after adding that code in the form_paint event.
Please send me your code if it is different from me which is working good in your machine.
Regards
Vijay
MJ
Mano J
Syncfusion Team
September 6, 2006 10:53 PM UTC
Hi Vijay,
Sorry for the delay in getting back to you. I did not make any major changes to the sample. I just moved the code from form_load to form_paint event and it works fine in my machine.
I checked this issue in VS 2003 using v.3.2.1.0. However I have attached the sample. Please check it and let me know.
WindowsApplication3_1.zip
Regards,
Mano
VK
Vijaya Kumar Reddy
September 7, 2006 09:53 AM UTC
Hi Mano,
While running the app I am getting the following exception..
An unhandled exception of type ''System.InvalidCastException'' occurred in WindowsApplication3.exe
Additional information: Specified cast is not valid.
It stops at the line 19 in Form1.cs. ....
((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).BeginInit();
Please look into this and let me know.
Thanks and regards
Vijay
VK
Vijaya Kumar Reddy
September 7, 2006 10:00 AM UTC
Hi Mano,
The line mo 19 in my previous post is incorrect. The correct Line no is 67.
Thanks and regards
Vijay
MJ
Mano J
Syncfusion Team
September 7, 2006 03:17 PM UTC
Hi Vijay,
Attached is the modified sample.
Thanks,
Mano
WindowsApplication3_1e.zip
VK
Vijaya Kumar Reddy
September 12, 2006 02:47 PM UTC
Hi,
I still not got the same colourschems for my gradient panel and as [er the headerbar of Groupbar control.
Request you to provide me a sample that works correctly for all the XPStyles.
Thanks for the help
Regards
Vijay
MJ
Mano J
Syncfusion Team
September 12, 2006 03:31 PM UTC
Hi Vijay,
The previous samples work fine in all XP Styles in our subsystems. Please refer the following link which explains about the usage of XPThemes.
Thanks,
Mano
MJ
Mano J
Syncfusion Team
September 12, 2006 03:34 PM UTC
Hi Vijay,
I think I have missed the link. Here is the link
http://codeproject.com/csharp/xptheme.asp
Thanks,
Mano
>Hi Vijay,
The previous samples work fine in all XP Styles in our subsystems. Please refer the following link which explains about the usage of XPThemes.
Thanks,
Mano