Indeed, you will have the real screen tip size too late for setting the ScreenTipNeededEventArgs.Offset in the ScreenTipNeeded event. Note that the screen tip's size is calculated when you are going to show it. But the ScreenTipNeeded event has already been fired providing the necessary information for the screen tip.
Before setting the offset, you can force measuring the screen tip and thus you will know its size. Please refer to the following code snippet:
this.radButton1.Text = "This is a very long text that needs more space to be displayed" + Environment.NewLine + "second " + Environment.NewLine + "third";
this.radButton1.ScreenTipNeeded += radButton1_ScreenTipNeeded;
RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
private void radButton1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
RadButtonElement element = e.Item as RadButtonElement;
if (e.Item != null)
screenTip.MainTextLabel.Font = new System.Drawing.Font("Arial", 16f, FontStyle.Bold);
screenTip.CaptionLabel.Text = "Select Employee Name";
screenTip.MainTextLabel.Text = "Current: " + element.Text;
screenTip.FooterTextLabel.Text = "Thank you!";
screenTip.FooterVisible = true;
element.ScreenTip = screenTip;
SizeF f = MeasurementControl.ThreadInstance.GetDesiredSize(screenTip, new SizeF(1000, 1000));
e.Offset = new System.Drawing.Size(0, (int)-f.Height);
Should you have further questions please let me know.
Dess | Tech Support Engineer, Sr.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.