How to prevent the Focus Rectangle from being drawn in the Tabs?
4 Feb 20251 minute to read
You can easily do this by handling the DrawItem event, adjusting the DrawTabEventArgs and delegating drawing to the default drawing logic.
private void TabControlExt_DrawItem(object sender, Syncfusion.Windows.Forms.Tools.DrawTabEventArgs drawItemInfo)
{
// To indicate that the tab gets drawn as if it’s not focused (without the focus rect).
drawItemInfo.State &= ~DrawItemState.Focus;
// Then forward drawing to default drawing logic.
drawItemInfo.DrawBackground();
drawItemInfo.DrawInterior();
drawItemInfo.DrawBorders();
}
Private Sub TabControlExt_DrawItem(sender As Object, drawItemInfo As Syncfusion.Windows.Forms.Tools.DrawTabEventArgs)
'To indicate that the tab gets drawn as if it’s not focused (without the focus rect).
Dim & As drawItemInfo.State = ~DrawItemState.Focus
'Then forward drawing to default drawing logic.
drawItemInfo.DrawBackground()
drawItemInfo.DrawInterior()
drawItemInfo.DrawBorders()
End Sub