3 Answers, 1 is accepted
Thank you for the question.
Our RadOffice2007ScreenTip supports displaying text and images and you can use it for the nodes of a RadTreeView. To do so, first subscribe to the ScreenTipNeeded event of the RadTreeView. Then, in the event handler set properties of the RadOffice2007ScreenTip:
RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement(); |
Size size = new Size(120, 50); |
Padding pad = new Padding(2); |
void radTreeView1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e) |
{ |
TreeNodeUI node = e.Item as TreeNodeUI; |
if (node != null) |
{ |
screenTip.MainImage.Image = WindowsApplication6.Properties.Resources.gear; |
screenTip.MainImage.Padding = pad; |
screenTip.CaptionLabel.Padding = pad; |
screenTip.CaptionLabel.Text = "Customers View"; |
screenTip.MainTextLabel.Text = node.Text; |
screenTip.EnableCustomSize = true; |
screenTip.AutoSize = false; |
screenTip.Size = size; |
node.ScreenTip = this.screenTip; |
} |
} |
I hope this helps. If you have additional questions, feel free to contact me.
Greetings,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Hello,
The post that you are referring to is quite old back to 2008. We have introduced a lot of new features and improvements in our controls since then. Please refer to the actual documentation where you can find more information about RadOffice2007ScreenTipElement: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/tooltips-and-screentips/screen-tips
Below you can find a sample code snippet of how you can assign an image to RadOffice2007ScreenTipElement:
RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
private void RadTreeView1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
{
TreeNodeElement node = e.Item as TreeNodeElement;
if (node != null)
{
screenTip.MainTextLabel.Image = Resources.usa;
screenTip.CaptionLabel.Text = "Customers View";
screenTip.MainTextLabel.Text = node.Text;
node.ScreenTip = this.screenTip;
}
}
I hope this helps. Let me know if you have any other questions.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.