|
Microsoft encourages anyone that develops something with a similar look and feel to the Office 2007 to acquire a free license from them. This binds developers to some guidelines in order to maintain the quality of the look and feel of the ribbonstrip-type control.
See here:
http://msdn2.microsoft.com/en-us/office/aa973809.aspx
|
|
|
|
|
Just been messing around with the ribbon control again and noticed on Vista Ultimate with the "grey" theme that the ribbon selected colours don't match the rest of it. Better explanation here[^].
|
|
|
|
|
you forget to add these functions to your form:
public void SetBase(int R, int G, int B, Color HaloColor)
{
this.SuspendLayout();
foreach (Control control in this.panel1.Controls)
{
if (typeof(RibbonStyle.TabStrip) == control.GetType())
{
((RibbonStyle.TabStripProfessionalRenderer)((RibbonStyle.TabStrip)control).Renderer).HaloColor = HaloColor;
((RibbonStyle.TabStripProfessionalRenderer)((RibbonStyle.TabStrip)control).Renderer).BaseColor = Color.FromArgb(R + 4, G + 3, B + 3);
for (int i = 0; i < ((RibbonStyle.TabStrip)control).Items.Count; i++)
{
RibbonStyle.Tab _tab = (RibbonStyle.Tab)((RibbonStyle.TabStrip)control).Items[i];
#region Set Tab Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
try
{
_tab.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
}
catch
{
_tab.ForeColor = Color.FromArgb(250, 250, 250);
}
}
else
{
try
{
_tab.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
}
catch
{
_tab.ForeColor = Color.FromArgb(10, 10, 10);
}
}
#endregion
}
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12);
}
if (typeof(RibbonStyle.TabPageSwitcher) == control.GetType())
{
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12);
foreach (Control _control in control.Controls)
{
if (typeof(RibbonStyle.TabStripPage) == _control.GetType())
{
((RibbonStyle.TabStripPage)_control).BaseColor = Color.FromArgb(R, G, B);
((RibbonStyle.TabStripPage)_control).BaseColorOn = Color.FromArgb(R, G, B);
foreach (Control __control in _control.Controls)
{
if (typeof(RibbonStyle.TabPanel) == __control.GetType())
{
#region Set TabPanel Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
try
{
__control.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
}
catch
{
__control.ForeColor = Color.FromArgb(250, 250, 250);
}
}
else
{
try
{
__control.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
}
catch
{
__control.ForeColor = Color.FromArgb(10, 10, 10);
}
}
#endregion
((RibbonStyle.TabPanel)__control).BaseColor = Color.FromArgb(R, G, B);
((RibbonStyle.TabPanel)__control).BaseColorOn = Color.FromArgb(R + 16, G + 11, B + 6);
foreach (Control ___control in __control.Controls)
{
if (typeof(RibbonStyle.RibbonButton) == ___control.GetType())
{
((RibbonStyle.RibbonButton)___control).InfoColor = Color.FromArgb(R, G, B);
RibbonStyle.RibbonButton _but = (RibbonStyle.RibbonButton)___control;
#region Set Button Colors
if (Color.FromArgb(R, G, B).GetBrightness() < 0.5)
{
try
{
_but.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66);
}
catch
{
_but.ForeColor = Color.FromArgb(250, 250, 250);
}
}
else
{
try
{
_but.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86);
}
catch
{
_but.ForeColor = Color.FromArgb(10, 10, 10);
}
}
#endregion
}
}
}
}
}
}
}
}
this.ResumeLayout(false);
}
public void SetStyle(string Name)
{
Color HaloColor = Color.White;
switch (Name)
{
case "Dark":
this.BackColor = Color.FromArgb(88, 77, 69);
HaloColor = Color.FromArgb(200, 200, 200);
SetBase(87, 61, 53, HaloColor);
break;
case "Nature":
this.BackColor = Color.FromArgb(78, 127, 52);
HaloColor = Color.FromArgb(254, 209, 94);
SetBase(73, 118, 46, HaloColor);
break;
case "Dawn":
this.BackColor = Color.FromArgb(177, 108, 45);
SetBase(172, 99, 39, Color.FromArgb(254, 209, 94));
break;
case "Corn":
this.BackColor = Color.FromArgb(230, 193, 106);
SetBase(225, 184, 100, Color.FromArgb(191, 219, 255));
break;
case "Chocolate":
this.BackColor = Color.FromArgb(87, 54, 34);
SetBase(82, 45, 28, Color.FromArgb(232, 80, 90));
break;
case "Navy":
this.BackColor = Color.FromArgb(88, 121, 169);
SetBase(84, 112, 163, Color.FromArgb(254, 209, 94));
break;
case "Ice":
this.BackColor = Color.FromArgb(235, 243, 236);
SetBase(228, 234, 230, Color.FromArgb(254, 209, 94));
break;
case "Vanilla":
this.BackColor = Color.FromArgb(233, 243, 213);
SetBase(228, 234, 207, Color.FromArgb(254, 209, 94));
break;
case "Canela":
this.BackColor = Color.FromArgb(235, 226, 197);
SetBase(228, 217, 191, Color.FromArgb(254, 209, 94));
break;
case "Cake":
this.BackColor = Color.FromArgb(235, 213, 197);
SetBase(228, 204, 198, Color.FromArgb(254, 209, 94));
break;
default:
this.BackColor = Color.FromArgb(191, 219, 255);
SetBase(215, 227, 242, Color.FromArgb(254, 209, 94));
break;
}
}
private void Form_Load(object sender, EventArgs e)
{
SetStyle("Azure");
}
Just another style...
|
|
|
|
|
Hi, it's a great job!
I found something. When you add many tabs onto the tabstrip, it will hide some tabs in the right, and you could click it, that's good, BUT:
1. When click a tab that hired (on the rigt), content of that tab is displayed, but none of tab displayed on tabStrip. I think it's a mistake.
2. The hired tab(on the rigt) is not be skined (on "Azure"). You could expand to see the hired tab, it shows the standard control color. It's bad looking.
Thanks.
123
|
|
|
|
|
Hi,
In the azure renderer, the tab shape is distorted when it is highlighted, there is like a box on the top half of the tab.
I want to change the azure renderer, to make the tab looks different when highlighted. i need to make the tab of 2 colors, the top half color to be light yellow(without boxes inside), and the bottom half color to be dark yellow (similar to office 2007 menus). if any one knows, you can contact me here or on my email: Olivia1982K@lycos.com
it is urgent, and sorry for my english language
thank you
Olivia
|
|
|
|
|
This is one of the best UI components that I have seen on code project! Brilliantly coded, and amazingly simple to use. Thank you so much for this
|
|
|
|
|
Hi everyone,
I have converted Setstyle("Azura") function to VB.Net. I get error on SetBase method for this line:
GetType(RibbonStyle.TabStrip) = control.[GetType]()
Which says:
Operator '=' is not defined for types 'system.type' and 'system.type'.
Can anybody help please? what do i have to do?
The reason i added these method and function into my forms is the tab set itself only to black!
Thanks in advance.
Kamal
|
|
|
|
|
It is something like that :
GetType(RibbonStyle.TabStrip).Equals(control.[GetType]())
Good luck!
|
|
|
|
|
Hi,
This is agreat control and great job done!
I am wondering how i can add Ribbon Button to my project? my project is VB.Net.
Thanks for your help.
Kamal
|
|
|
|
|
Hi everyone,
going through the forum I found the solution to this problem. if you look for this thread, the answer is there:
Re: How to add TabPanel & RibbonButton to the ToolBox?
You need to add RibbonButton.cs, infoform.cs and TabPanel.cs to the toolkit project that Juan provided! then build the project and you would get the full set of controls.
Regards,
Kamal
|
|
|
|
|
Yes, I have noticed these. But my project is VB.net and can't add these cs files. So why not bulid these two components into one dll?
|
|
|
|
|
Hi,
Have the same issue, did you find away to do this?
|
|
|
|
|
This is an awesome control. However, after converting to dll's and incorporating into a new vb project I find that the tabs are black. I read that I need to use the setstyle("azure") but I'm not sure how to replicate that in my form (as is in form1 of the demo).
-- modified at 11:42 Wednesday 29th August, 2007
|
|
|
|
|
Hi,
Did you figure out how to fix the color of the tab? I have the same problem.
Thanks for you help.
mv
|
|
|
|
|
Following Code works:
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
SetStyle("Azure")
End Sub
Public Sub SetStyle(ByVal Name As String)
Dim HaloColor As Color = Color.White
Select Case Name
Case "Dark"
'this.BackColor = Color.FromArgb(88,77,69);
HaloColor = Color.FromArgb(200, 200, 200)
SetBase(87,61,53,HaloColor)
Case "Nature"
'this.BackColor = Color.FromArgb(78, 127, 52);
HaloColor = Color.FromArgb(254, 209, 94)
SetBase(73, 118, 46,HaloColor )
Case "Dawn"
'this.BackColor = Color.FromArgb(177, 108, 45);
SetBase(172, 99, 39, Color.FromArgb(254, 209, 94))
Case "Corn"
'this.BackColor = Color.FromArgb(230, 193, 106);
SetBase(225, 184, 100, Color.FromArgb(191, 219, 255))
Case "Chocolate"
'this.BackColor = Color.FromArgb(87, 54, 34);
SetBase(82, 45, 28, Color.FromArgb(232, 80, 90))
Case "Navy"
'this.BackColor = Color.FromArgb(88,121,169);
SetBase(84, 112, 163, Color.FromArgb(254, 209, 94))
Case "Ice"
'this.BackColor = Color.FromArgb(235, 243, 236);
SetBase(228, 234, 230, Color.FromArgb(254, 209, 94))
Case "Vanilla"
'this.BackColor = Color.FromArgb(233, 243, 213);
SetBase(228, 234, 207, Color.FromArgb(254, 209, 94))
Case "Canela"
'this.BackColor = Color.FromArgb(235, 226, 197);
SetBase(228, 217, 191, Color.FromArgb(254, 209, 94))
Case "Cake"
'this.BackColor = Color.FromArgb(235, 213, 197);
SetBase(228, 204, 198, Color.FromArgb(254, 209, 94))
Case "Azure"
'this.BackColor = Color.FromArgb(191, 219, 255);
SetBase(215, 227, 242, Color.FromArgb(254, 209, 94))
End Select
End Sub
Public Sub SetBase(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer, ByVal HaloColor As Color)
Me.SuspendLayout()
For Each control As Control In Me.Panel1.Controls
If TypeOf (control) Is RibbonStyle.TabStrip Then
CType((CType(control, RibbonStyle.TabStrip)).Renderer, RibbonStyle.TabStripProfessionalRenderer).HaloColor = HaloColor
CType((CType(control, RibbonStyle.TabStrip)).Renderer, RibbonStyle.TabStripProfessionalRenderer).BaseColor = Color.FromArgb(R + 4, G + 3, B + 3)
Dim i As Integer
For i = 0 To (CType(control, RibbonStyle.TabStrip)).Items.Count - 1 Step i + 1
Dim _tab As RibbonStyle.Tab = CType((CType(control, RibbonStyle.TabStrip)).Items(i), RibbonStyle.Tab)
If Color.FromArgb(R, G, B).GetBrightness() < 0.5 Then
Try
_tab.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66)
Catch
_tab.ForeColor = Color.FromArgb(250, 250, 250)
End Try
Else
Try
_tab.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86)
Catch
_tab.ForeColor = Color.FromArgb(10, 10, 10)
End Try
End If
Next
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12)
End If
If TypeOf (control) Is RibbonStyle.TabPageSwitcher Then
control.BackColor = Color.FromArgb(R - 24, G - 8, B + 12)
For Each _control As Control In control.Controls
If TypeOf (_control) Is RibbonStyle.TabStripPage Then
CType(_control, RibbonStyle.TabStripPage).BaseColor = Color.FromArgb(R, G, B)
CType(_control, RibbonStyle.TabStripPage).BaseColorOn = Color.FromArgb(R, G, B)
For Each __control As Control In _control.Controls
If TypeOf (__control) Is RibbonStyle.TabPanel Then
If Color.FromArgb(R, G, B).GetBrightness() < 0.5 Then
Try
__control.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66)
Catch
__control.ForeColor = Color.FromArgb(250, 250, 250)
End Try
Else
Try
__control.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86)
Catch
__control.ForeColor = Color.FromArgb(10, 10, 10)
End Try
End If
CType(__control, RibbonStyle.TabPanel).BaseColor = Color.FromArgb(R, G, B)
CType(__control, RibbonStyle.TabPanel).BaseColorOn = Color.FromArgb(R + 16, G + 11, B + 6)
For Each ___control As Control In __control.Controls
If TypeOf (___control) Is RibbonStyle.RibbonButton Then
CType(___control, RibbonStyle.RibbonButton).InfoColor = Color.FromArgb(R, G, B)
Dim _but As RibbonStyle.RibbonButton = CType(___control, RibbonStyle.RibbonButton)
If Color.FromArgb(R, G, B).GetBrightness() < 0.5 Then
Try
_but.ForeColor = Color.FromArgb(R + 76, G + 71, B + 66)
Catch
_but.ForeColor = Color.FromArgb(250, 250, 250)
End Try
Else
Try
_but.ForeColor = Color.FromArgb(R - 96, G - 91, B - 86)
Catch
_but.ForeColor = Color.FromArgb(10, 10, 10)
End Try
End If
End If
Next
End If
Next
End If
Next
End If
Next
Me.ResumeLayout(False)
End Sub
|
|
|
|
|
Hi,
Please tell me, how to add a child form for this MDI form.
|
|
|
|
|
I added the following to RibbonPanel and called to it versus calling Color.FromArgb direct:
protected static int FromArgbBindComponent( int inComponent )
{
inComponent = (inComponent >= 0 ? inComponent : 0);
inComponent = (inComponent <= 255 ? inComponent : 255);
return( inComponent );
}
protected static Color FromArgb( int inRed, int inGreen, int inBlue )
{
return( Color.FromArgb( RibbonPanel.FromArgbBindComponent( inRed ),
RibbonPanel.FromArgbBindComponent( inGreen ), RibbonPanel.FromArgbBindComponent( inBlue ) ) );
}
protected static Color FromArgb( int inAlpha, int inRed, int inGreen, int inBlue )
{
return( Color.FromArgb( inAlpha, RibbonPanel.FromArgbBindComponent( inRed ),
RibbonPanel.FromArgbBindComponent( inGreen ), RibbonPanel.FromArgbBindComponent( inBlue ) ) );
}
TripNTango
|
|
|
|
|
I used the Ribbon Panel Office 2007 in a project and works very well, but then I read the document where you inherit your control, and for some reasons I will use a tabControl, so I look the TabStripControl Base class on the example from the document and I'd like to use this control at the same time that your control.
I noticed one problem, both have the same project name, I tried to change the property at design time to make the Panel looks like the base class but with no result.
what can I do to use both control in the same project ?
do you have any idea?
|
|
|
|
|
Hello there,
do you know how to manage the Ribbon Control into a User Control (not FormView)?
Thanks, L.
|
|
|
|
|
It would be a really useful feature, anyone tried?
|
|
|
|
|
When tab strip has large number of tab, it will hide some tabs in the right, but when click a tab that hired (in the rigth), content of that tab is displayed, but none of tab displayed on tabStrip.
Please help me.
Thanks in advance.
thachvv
|
|
|
|
|
Hi,
I have tested this component using C#. I have faced one problem which is displaying unicode character with RibbonButton and TabPanel. How could I over come this problem?
Dina So
|
|
|
|
|
Does someone try to use the dll in a WPF Appliacation? I can't see any controls of the library in my toolbox :-/
If i click "See All" in my toolbox i can see the controls, but they are disabled. Does the library only works with .Net 2.0?
greets Mariusz
|
|
|
|
|
It doesn't work for me in VB.Net OR C#. Here's the error message I get:
Unable to find assembly 'TabStripControlLibrary, Version=1.0.2764.37942, culture=neutral, PublicKeyToken=null'
This is awesome and I can't use it!
|
|
|
|
|
Choose to build without run, then run it. It needs to compile the supporting DLL.
|
|
|
|
|