473,850 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resizing th TABCONTROL in c#

39 New Member
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 11668
tlhintoq
3,525 Recognized Expert Specialist
Programmaticall y change the .Location, .Width, .Height properties.
Handle the Form.SizeChange d event
then resize/relocate the controls with something like

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

etc.
Jul 10 '09 #2
ThatThatGuy
449 Recognized Expert Contributor
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 Recognized Expert Specialist
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
294
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... I've also tryied to set the locked property of the form to true, with no success. Which could be the problem? Thank you,
11
18852
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 they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
5
18517
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 custom control that inherit all information from TabPage, but how to access those properties, not supported by standart interface??? Thank you
2
2377
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 controls on it. The problem is that I don't know how to bring up the graphical design interface for the TabControl. I suppose I COULD just design it as a UserControl and place a TabControl on it, but that seems a bit... inelegant (I'm going to...
9
3464
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 the are set to the right color, I can obviously change the tabpage colour but I am left with a grey top edge(Where there are no buttons) when the background of the form is changed any ideas on what I can do? Mike.
2
3363
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 - including the tab control. I did this by writing a component that I attached to the form. The component has a "Start" function which takes the form as a paramater. This cycles through all the controls on the form, changes some of the properties...
1
3466
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 know how to fix this? I tried this on two computers, at work and at home, both with Windows XP with latest service packs, and Framework 2.0 and 3.0 with latest SP.
4
2314
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 ToolStripButtons selects the correct tab. Each tab page has a TableLayoutPanel that is fill-docked and contains the controls. As part of the tool strip button click event, I would like to change the height of the form to remove any empty space at the bottom of...
0
9741
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10666
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10724
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10351
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5929
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4546
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.