By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Resize Tab control when windows form resizes

P: n/a
Hi

I have a windows form and with init I have a tab control.

How can I get the tab control to resize, Min/Max as the windows form is
resized?

Thanks

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In the Form's resize event code block, insert code changing the tab control's
dimensions relative to the form's. Example:

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Resize
TabControl1.Width = Me.Width - 20
TabControl1.Height = Me.Height - 20
End Sub

You can use any arithmetic operator and any values within reason; just
depends on what your needs are.

Randall Arnold

"BrianDH" wrote:
Hi

I have a windows form and with init I have a tab control.

How can I get the tab control to resize, Min/Max as the windows form is
resized?

Thanks

Nov 21 '05 #2

P: n/a
It Works! TY

"Randall Arnold" wrote:
In the Form's resize event code block, insert code changing the tab control's
dimensions relative to the form's. Example:

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Resize
TabControl1.Width = Me.Width - 20
TabControl1.Height = Me.Height - 20
End Sub

You can use any arithmetic operator and any values within reason; just
depends on what your needs are.

Randall Arnold

"BrianDH" wrote:
Hi

I have a windows form and with init I have a tab control.

How can I get the tab control to resize, Min/Max as the windows form is
resized?

Thanks

Nov 21 '05 #3

P: n/a
"BrianDH" <Br*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
How can I get the tab control to resize, Min/Max as the windows form
is resized?


Take a look at the Anchor and Dock properties or, if neither of
those do the job, add some code to the Form's Layout event,
as in

Private Sub Form1_Layout( ... ) handles Form1.Layout
With TabControl2
.Location = New Point( 8, 8 )
.Size = New Size( Me.ClientSize.Width - 16 _
Me.ClientSize.Height - 16 _
)
End With
End Sub

HTH,
Phill W.
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.