简体   繁体   中英

Changing a tabcontrol's Font changes the size of the content

I am creating a program that's for use with touchscreens. Everything has to be quite big for usability.

At some point I realized some controls (groupbox with flowpanel inside which contains buttons) had to move inside a tabcontrol to make better use of the resolution we have. Everything went fine until I changed the font size of the tabcontrol's headers. When I change the header font size to a bigger font size (20) all the content grows too. With the content I mean everything. Everything the tabcontrol contains grows along with the header font size. I really don't know what to do here. Is this a bug or what's going on?

I have also tried to change the font size in code, with the same result.

Is there anyone who had the same experience? Or anyone who can reproduce this problem?

SxMT

Your tab control is probably scaling because of font change. See this

TabControl -> UserControl -> GroupBox

The problem was that when I changed the font size of the TabControl the font size for all children changed. I had changed the font size for the group box manually but that didn't solve the problem. I had to change font size of the User Control itself instead of the content of the User Control so that it didn't resize.

This is quite confusing because the User Control didn't contain any text directly. Changing the font size of the User Control affects the font size of the children, changing the font size of the children directly didn't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM