473,395 Members | 1,443 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,395 software developers and data experts.

Resizing th TABCONTROL in c#

39
hi ,

Im new to c# , currently i'm developing an UI . i have used windows form in this , i have created my own maximise , minimise and close buttons for the form . the form also contains a Tabcontrol . when i click on the maximise button of the form i'm setting the properties of the form to FormWindowState.Maximized; now i want my tabcontrol also to be resized to the width of my form , how can i achieve this??? please help ASAP :)

thank u
Jul 10 '09 #1
3 11633
tlhintoq
3,525 Expert 2GB
Programmatically change the .Location, .Width, .Height properties.
Handle the Form.SizeChanged event
then resize/relocate the controls with something like

myTabpage.width = this.width - 40;
myTabpage.height = this.height - 100;

etc.
Jul 10 '09 #2
ThatThatGuy
449 Expert 256MB
the post by tlhintoq was cool enough but why to increase the lines of code when there are built in properties for doing that....

Select the tabControl and in the properties window
go to the Property named Anchor...
and from the drop down select right,left,top,bottom or wherever you want it to extend with the form....it happens automatically...
cheers.....
you can save those 2 lines of code...
Jul 13 '09 #3
tlhintoq
3,525 Expert 2GB
I'm used to repositioning and resizing many controls based on the layout of the form. If it a certain default size (portrait in shape) then the user shrinks the height and widens it out, some controls move up and to the right for an example.

Besides, for someone learning I think its good to learn the details and not just straight to the things that do the work for them. First learn to drive a stick shift. Then later learn there is such a thing as automatic transmission.
Jul 13 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Giulio Mastrosanti | last post by:
Hi all, I have a vb net project with a form that contains a tabcontrol, And while working randomly the height of the form changes, and the order of the tabpages of the tabcontrol changes too......
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
by: Tamir Khason | last post by:
How be able to manage more deeply UI of TabControl and TabPage For example - I want to manage border color, change color of TabPage reef, eliminate spaces from both sides of the reef, so I bould...
2
by: Patrick McGuire | last post by:
I want to place a tabControl with almost identical properties on several forms. I think the best way is to define a UserControl that inherits System.Windows.Forms.TabControl, and place all my...
9
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so...
2
by: Simon Verona | last post by:
I have a few hundred forms in my application. All are based on a custom base form class. I decided that I wanted to globally change the look and feel of many of the controls in my application -...
1
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all In a Visual Studio 2005 C# project, I have a simplest tabcontrol with two tabpages. When I set tab control's Alignment property to Right, tab texts (captions) disappear. Does anybody...
4
SammyB
by: SammyB | last post by:
I have a form with a ToolStrip at the top and a TabControl just below it. The TabControl fills the rest of the form and has it's tabs on the right, off of the form. The click event of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.