G
Guest
I have a problem which I have been able to reproduce in a very simple project.
I have a form with a single tabcontrol control with two tab pages. The
tabcontrol's Anchor property is set to Top, Left, Bottom, Right (all 4
directions). On each tabpage, I have a DataGrid. Each DataGrid's Anchor
property is also set to Top, Left, Bottom, Right. I developed this simple
application with my System's DPI setting set to Normal Size (96) and
everything worked perfectly.
The problem came, however, when I changed my DPI setting to Large (120).
The datagrid on the first tabpage (index 0) did not have the correct size
(too large). On the second tabpage (and any others that were present in
subsequent tests), everything was sized correctly.
The same problem happens in reverse (developing in Large and moving to
Normal).
My workaround was to create an empty tabpage at the beginning of the set and
remove it from the tabcontrol's TabPages collection during the form's load
event handler. I could have also not used anchor and changed the control's
width during the form's resize event.
Any non-hack solution or explanation would be appreciated.
I have a form with a single tabcontrol control with two tab pages. The
tabcontrol's Anchor property is set to Top, Left, Bottom, Right (all 4
directions). On each tabpage, I have a DataGrid. Each DataGrid's Anchor
property is also set to Top, Left, Bottom, Right. I developed this simple
application with my System's DPI setting set to Normal Size (96) and
everything worked perfectly.
The problem came, however, when I changed my DPI setting to Large (120).
The datagrid on the first tabpage (index 0) did not have the correct size
(too large). On the second tabpage (and any others that were present in
subsequent tests), everything was sized correctly.
The same problem happens in reverse (developing in Large and moving to
Normal).
My workaround was to create an empty tabpage at the beginning of the set and
remove it from the tabcontrol's TabPages collection during the form's load
event handler. I could have also not used anchor and changed the control's
width during the form's resize event.
Any non-hack solution or explanation would be appreciated.