Monday, 8 October 2012

C# Tabstrip control doesn't paint correctly on resize or maximize




When you are using a docked or anchored Tabstrip control in visual studio you may find that it doesn't paint correctly on resize or maximize

Normally...



Maximized...





After having added code to refresh the tabstrip on resize I found this doesn't solve the problem.

The key is to perform the refresh in the SizeChanged event of the control. This will redraw the control correctly.


  private void TabControl_SizeChanged(object sender, EventArgs e)
  {
         TabControl.Refresh();
  }

No comments:

Post a Comment