Hello Daniel,
Please refer to the following code snippet in order to avoid that gray rectangle behind the custom shape of the screen tip:
public RadForm1()
{
InitializeComponent();
this.radButton1.ScreenTipNeeded += this.NewRadButton1_ScreenTipNeeded;
}
private void NewRadButton1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
{
PropertyInfo barProperty = ((ComponentBehavior)this.radButton1.Behavior).GetType().GetProperty("ScreenPresenter",
BindingFlags.NonPublic | BindingFlags.Instance);
Form screenTipForm = barProperty.GetValue(((ComponentBehavior)this.radButton1.Behavior), null) as Form;
screenTipForm.BackColor = this.BackColor;
screenTipForm.TransparencyKey = this.BackColor;
IntPtr hWnd = screenTipForm.Handle;
int GCL_STYLE = -26;
int ClassLong = NativeMethods.GetClassLongPtr(new HandleRef(null, hWnd), GCL_STYLE).ToInt32();
if ((ClassLong & NativeMethods.CS_DROPSHADOW) != 0)
{
ClassLong ^= NativeMethods.CS_DROPSHADOW;
NativeMethods.SetClassLong(new HandleRef(null, hWnd), GCL_STYLE, (IntPtr)ClassLong);
}
}
I hope this helps. Do not hesitate to contact us if you have other questions.
Regards,
Nadya
Progress Telerik
Progress is here for your business, like always.
Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.