How to make the UserControl fill the entire TabPage

1

I'm putting a UserControl inside a TabPage. When Not Maximized, the UserControl fills in the entire TabControl

However,ifImaximizethescreen,thereisaspacetotheright.

Iusedusercontrolwinforms"Anchor" or "Dock" property. So I tried the following

control.Dock = DockStyle.Fill
control.Dock = AutoScaleMode.None

I have tried it too, but it only centralizes the Usercontrol.

control.Anchor = AnchorStyles.None
control.Left = (tab.Width - control.Width) / 2
control.Top = (tab.Height - control.Height) / 2
    
asked by anonymous 14.01.2016 / 19:39

1 answer

0

If you edit some property like Control.Top or Control.Anchor the Dock property will be discarded. You may want to edit only the Dock property of the control, nothing else.

control.Dock = DockStyle.Fill

If you wrap in the Anchor property after Dock , the collage will be discarded.

    
20.01.2016 / 00:47