c# tabcontrol - tabpage
I am trying to add a tab page programmatically to a ta开发者_JAVA百科bcontrol.
I can do this no problem, but it seems when I add it, it is automatically sized to only 200px in width, and I cannot work out how to resize it. The tabpage is created in a dll, and is returned to the main client whereby it is added to the tabcontrol, but as I say when it is added it is only 200px wide, and any further controls I add onto that tabpage will not show if positioned more than 200px wide.
Any ideas?
Thanks.
Either change the Size
property
myTabControl.Size = new System.Drawing.Size(400, 400);
or the Height
/ Width
properties
myTabControl.Height = 400;
myTabControl.Width = 400;
or the Dock
property
// Size the tab control to take up all available space in parent container
myTabControl.Dock = DockStyle.Fill;
精彩评论