I have a Windows Forms application with a TabControl
that has two TabPage
objects:
What I am aming for is a way to display an icon beside the titles of the tabs. For that, an ImageList
is assigned to the TabControl
so the ImageIndex
property of the tab pages can be set. When I do that in the designer, it looks fine, but when changing it programatically in my code like this:
myTabControl.TabPages[0].ImageIndex = 0
, it has this weird overlapping effect:
How can I avoid this? Things I've tried are myTabControl.PerformLayout()
and myTabControl.Invalidate()
, but none of them worked. Thanks!