This question is locked. New answers and comments are not allowed.
As per the instructions given in this thread: http://www.telerik.com/community/forums/thread/b311D-mkmhd.aspx I was able to successfully change the backcolor of a tab programmatically. When I try to reset the tab color back to its original color, it works fine, except that the color stays changed until I hover over the tab, and then it fully returns to normal.
For example, I have a tab strip with the default blue colored tabs. I click a button to change one of the tabs to yellow, and it works. I click another button to change the color back to the original blue color, but the tab still remains yellow. When I hover my mouse over the yellow tab, it changes to the hover color, and when I hover away from the tab, it returns to its original blue color.
Here is a sample of my code used to make the tab turn yellow:
Here is the code I use to return all tabs to their default color:
Please let me know what I am doing wrong, as it is quite annoying to have to hover over all the tabs everytime I want to see which ones are really supposed to have a different backcolor.
For example, I have a tab strip with the default blue colored tabs. I click a button to change one of the tabs to yellow, and it works. I click another button to change the color back to the original blue color, but the tab still remains yellow. When I hover my mouse over the yellow tab, it changes to the hover color, and when I hover away from the tab, it returns to its original blue color.
Here is a sample of my code used to make the tab turn yellow:
Dim oFillSelector As New ClassSelector("TabFill") |
Dim oTabFill As FillPrimitive = TryCast(oFillSelector.GetSelectedElements(Me.tsTabs.SelectedTab)(0), FillPrimitive) |
If oTabFill.BackColor <> Color.Yellow Then |
oTabFill.BackColor = Color.Yellow |
oTabFill.BackColor2 = Color.Yellow |
oTabFill.BackColor3 = Color.Yellow |
oTabFill.BackColor4 = Color.Yellow |
End If |
Here is the code I use to return all tabs to their default color:
For i as int32 = 0 to Me.tsTabs.Items.Count -1 |
Dim oFillSelector As New ClassSelector("TabFill") |
Dim oTabFill As FillPrimitive = TryCast(oFillSelector.GetSelectedElements(Me.tsTabs.Items(i))(0), FillPrimitive) |
oTabFill.ResetValue(FillPrimitive.BackColorProperty) |
oTabFill.ResetValue(FillPrimitive.BackColor2Property) |
oTabFill.ResetValue(FillPrimitive.BackColor3Property) |
oTabFill.ResetValue(FillPrimitive.BackColor4Property) |
Next |
Please let me know what I am doing wrong, as it is quite annoying to have to hover over all the tabs everytime I want to see which ones are really supposed to have a different backcolor.