10 Answers, 1 is accepted
0
Hello Andre,
Thank you for writing.
Setting the BackColor of the TileElement in code has higher precedence than the theme and this is why the hover color is not applied. You have two options:
1. Modify the default theme and change the tile BackColor in it - see attached image demonstrating which repository you should modify. Here are some additional links that you might find useful:
2. Subscribe to the MouseEnter event of your tiles and when it occurs change the tile BackColor. Also, you will need to reset this setting when the MouseLeave event occurs:
I hope this helps.
Regards,
Stefan
the Telerik team
Thank you for writing.
Setting the BackColor of the TileElement in code has higher precedence than the theme and this is why the hover color is not applied. You have two options:
1. Modify the default theme and change the tile BackColor in it - see attached image demonstrating which repository you should modify. Here are some additional links that you might find useful:
- Loading predefined themes
- Working with Repository Items
- Saving and Loading Theme Files
- Loading Themes from an External File
- Loading Themes from a Resource
- Applying Theme to a Control
- http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010
2. Subscribe to the MouseEnter event of your tiles and when it occurs change the tile BackColor. Also, you will need to reset this setting when the MouseLeave event occurs:
void
Form1_MouseLeave(
object
sender, EventArgs e)
{
RadTileElement el = (RadTileElement)sender;
el.BackColor = Color.Red;
}
void
Form1_MouseEnter(
object
sender, EventArgs e)
{
RadTileElement el = (RadTileElement)sender;
el.BackColor = Color.Yellow;
}
I hope this helps.
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
I forgot the attachment. Here is it.
Kind regards,
Stefan
the Telerik team
Kind regards,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Andre
Top achievements
Rank 1
answered on 30 Jan 2013, 01:50 PM
Thanks. This is helpful. I'm trying to decide which way to go. I'd like to have tiles of various colors. Just so i understand correctly, if i went with your first suggestion, would i have to create several themes? ( One for each color? )
If so, maybe it'd be easier, if i did the color change in code like you suggest in option 2.
Thanks again for your help.
If so, maybe it'd be easier, if i did the color change in code like you suggest in option 2.
Thanks again for your help.
0
Hello Andre,
If you want to have different colors for the different tiles, you should go with option 2 since in the theme you can set just the default color for all tiles used in RadPanorama.
Greetings,
Stefan
the Telerik team
If you want to have different colors for the different tiles, you should go with option 2 since in the theme you can set just the default color for all tiles used in RadPanorama.
Greetings,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
0
Andre
Top achievements
Rank 1
answered on 30 Jan 2013, 02:52 PM
Sorry, I looked into this a little further, I'll hook up the handlers in code i.e.
Thanks for all your help. Very responsive.
radTileElement1.MouseHover += new EventHandler(radTileElement1_MouseHover);
Thanks for all your help. Very responsive.
0
Andre
Top achievements
Rank 1
answered on 21 Feb 2013, 02:20 AM
There seems to be a problems with this solution when using groups. The mouseEnter event is triggered, but the mouseLeave event is not.
Is this a know bug?
Is this a know bug?
0
Hello Andre,
Thank you for writing back.
It seems that there is an issue with the MouseLeave event in this case. I will log it in our Public Issue Tracking System and we will address it accordingly. Here is the link to it: http://www.telerik.com/support/pits.aspx#/public/winforms/14359.
Your Telerik Points have been updated for this report.
As a workaround, you can use the control's MouseMove event in the following manner:
I hope this helps.
Greetings,
Stefan
the Telerik team
Thank you for writing back.
It seems that there is an issue with the MouseLeave event in this case. I will log it in our Public Issue Tracking System and we will address it accordingly. Here is the link to it: http://www.telerik.com/support/pits.aspx#/public/winforms/14359.
Your Telerik Points have been updated for this report.
As a workaround, you can use the control's MouseMove event in the following manner:
RadTileElement saveTile;
void
radPanorama1_MouseMove(
object
sender, MouseEventArgs e)
{
RadTileElement tile = radPanorama1.ElementTree.GetElementAtPoint(e.Location)
as
RadTileElement;
if
(tile !=
null
)
{
if
(saveTile !=
null
)
{
saveTile.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
}
tile.BackColor = Color.Yellow;
saveTile = tile;
}
else
if
(saveTile !=
null
)
{
saveTile.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
}
}
I hope this helps.
Greetings,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Derek
Top achievements
Rank 1
answered on 17 Jun 2013, 02:06 PM
Stefan,
Thank you for the code. This is a nice work around for tiles that are in groups. However, this example voids the set backcolor for the tile once the mouse leaves the tile. So, the mouse will enter the tile for a nice scroll over effect, but then it resets the backcolor to the default blue for the control. Is there a way to go back to a set backcolor?
Thanks,
Derek
Thank you for the code. This is a nice work around for tiles that are in groups. However, this example voids the set backcolor for the tile once the mouse leaves the tile. So, the mouse will enter the tile for a nice scroll over effect, but then it resets the backcolor to the default blue for the control. Is there a way to go back to a set backcolor?
Thanks,
Derek
0
Hello,
No, there is no way to revert back to another locally set BackColor. What I can offer is to store the desired color for a tile in its Tag property and instead of using the reset, get the color from the Tag and set it instead.
I hope this will work for you.
Regards,
Stefan
Telerik
No, there is no way to revert back to another locally set BackColor. What I can offer is to store the desired color for a tile in its Tag property and instead of using the reset, get the color from the Tag and set it instead.
I hope this will work for you.
Regards,
Stefan
Telerik
RadChart for WinForms is obsolete. Now what?