4 Answers, 1 is accepted
0
Accepted
Hi vighnesh,
Thank you for the question.
In order to change the colors of a RadListBoxItem on mouse hover, please subscribe to its MouseEnter and MouseLeave events:
I hope this helps. If you have additional questions, feel free to contact me.
Kind regards,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you for the question.
In order to change the colors of a RadListBoxItem on mouse hover, please subscribe to its MouseEnter and MouseLeave events:
public partial class Form1 : Form |
{ |
public Form1() |
{ |
InitializeComponent(); |
for (int i = 0; i < this.radListBox1.Items.Count; i++) |
{ |
((RadListBoxItem)this.radListBox1.Items[i]).MouseLeave += new EventHandler(Form1_MouseLeave); |
((RadListBoxItem)this.radListBox1.Items[i]).MouseEnter += new EventHandler(Form1_MouseEnter); |
} |
} |
void Form1_MouseEnter(object sender, EventArgs e) |
{ |
RadListBoxItem item = sender as RadListBoxItem; |
(((FillPrimitive)item.Children[0])).BackColor = Color.Orange; |
(((FillPrimitive)item.Children[0])).BackColor2 = Color.Red; |
(((FillPrimitive)item.Children[0])).BackColor3 = Color.Red; |
(((FillPrimitive)item.Children[0])).BackColor4 = Color.Red; |
} |
void Form1_MouseLeave(object sender, EventArgs e) |
{ |
RadListBoxItem item = sender as RadListBoxItem; |
(((FillPrimitive)item.Children[0])).BackColor = Color.White; |
(((FillPrimitive)item.Children[0])).BackColor2 = Color.White; |
(((FillPrimitive)item.Children[0])).BackColor3 = Color.White; |
(((FillPrimitive)item.Children[0])).BackColor4 = Color.White; |
} |
} |
I hope this helps. If you have additional questions, feel free to contact me.
Kind regards,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
vighnesh
Top achievements
Rank 1
answered on 18 Feb 2009, 01:29 PM
Thank you. that worked for me.
0
Amir
Top achievements
Rank 1
answered on 19 Jun 2015, 03:38 PM
I do have the latest version of DevCraft but I cannot find the right lib for the FillPrimitive.
I am not seeing any WinControls.Primitives to add to VS resources!
0
Hello Amir,
Thank you for writing.
The FillPrimitive class is located in the Telerik.WinControls.dll assembly, so in order to access them you would need to reference it.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
Thank you for writing.
The FillPrimitive class is located in the Telerik.WinControls.dll assembly, so in order to access them you would need to reference it.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items