473,408 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Resize Tab control when windows form resizes

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
3 16064
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Baker | last post by:
I want to show the parent name of a control in an addin I am writing. However, when I use the following : string parentName = thisControl.Parent.Name // thisControl is of type Control it is...
2
by: Miky | last post by:
Hi, I have the following problem: I have a .CFM web page and I have to populate, from VB, two textboxes on it. I was thinking using sendkeys (even if I don't like it too much) but when I...
0
by: Pranati | last post by:
My windows forms(vb.net) application has a web browser control that is navigating to an asp.net web application(aspx) . The aspx page has an grid control . How can i capture the click event of the...
4
by: Aung Thu | last post by:
Hi, there! I want to set focus on a control, of which TabIndex is not the first, when a form is loaded. In the form's load event, I have used Control.Focus() but it doesn't not work. The focus...
1
by: PW | last post by:
Hi, Is it possible to make a control bigger or maximize it also when the user maximizes the form? I have a calendar control on a form and I would like to automatically make it bigger when the...
5
by: Amit | last post by:
Can anyone write the code to hide tabpage of tab control in windows form 2.0 Thanks, Amit
8
by: Mulm3h | last post by:
Hi, Me to Express vb 2k5 As I could remember there was a funtion in the old VB where simply type "Time" or something then it will show you the real time and second appear on the label. Is that...
6
by: Tarren | last post by:
Hi: I am trying to get access to the event after a window has been resized. The events I have been using SizeChanged and Resize all fire after any pixel size change. What I am trying to...
1
mahboobeh
by: mahboobeh | last post by:
hi I want to transparent a wpf control in a winapp. I know that i can transparent the normal form and set its opacuty=0.if i transparent wpf control The background of the parent WPF control...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.