when i put this code in my form constructor after the IntializeComponet
It tells me that the TabControl doesn't exist.
I have this.Anchor, this.TabStop, this.tabstopchanged, from intellisense for my options.
I am using the OakLeaf.MM.Main.Windows.Forms.mmBusinessForm
Thanks,
>Shawn,
>
>This is actually a VS .NET / Windows Forms problem, and it all boils down to this: The last object to be resized is the form itself. Here's the details:
>
>When the form instantiates, the code that instantiates and resizes the TabControl fires first, then the code that instantiates the TabControl’s contained controls fires next…INCLUDING the code that anchors the TabControl to the form. Next, code that resizes the form is fired! Since the TabControl is already a larger size than the form (because it was sized first), when the form is resized, the TabControl is resized proportionately, making it larger than it should be (and in fact, too large for the containing form).
>
>I tried lots of different workarounds for this, but since you can’t control what the VS .NET designers are doing, the only way I could get around it is to set the anchoring property of the TabControl AFTER the form is already resized.
>
>I put this code in the form’s constructor AFTER the call to InitializeComponent:
>
>
this.TabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
> | System.Windows.Forms.AnchorStyles.Left)
> | System.Windows.Forms.AnchorStyles.Right)));
>
>Since the TabControl is not anchored until after the form is resized, it works like a charm.
>
>Regards,