After some research, it appeared to be a known Microsoft issue as described in this post: https://bytes.com/topic/c-sharp/answers/457492-tabpage-text-disapearing
However, I was not convinced this would be an ideal solution. I wanted something quick and simple. I ran a test and noticed when adding TabPages to the test SplitContainer, that the TabPage title did not disappear. Also the test did not contain a MenuStrip control, which the client app did.
Then I suspected the menu was causing the problem, because it was overlapping the TabPage title, and the title text was not disappearing at all.
To solve it, I simply added some padding to the SplitContainer panel, to push it below the MenuStrip in the client application. Here is some code.
SplitContainer1.Panel1.Padding = new Padding(0, 27, 0, 0);
27 represents the default height in pixels of a MenuStrip, the top padding on the SplitContainer panel should then clear the menu and the title text will show.
No comments:
Post a Comment