473,625 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change tab width in ownerdrawn tabcontrol

hi there.
I am creating a tabcontrol where the drawing of the tabs is controlled by
me.
However, i cannot find a way to change the lenght of the tab.
For instance, "String" needs a smaller tab than a tab which text is "this is
a tab with a really really long text".
How can this be done, the changing of the width of the tab?
Thanks!

André Nogueira
Nov 20 '05 #1
4 6260
If you've inherited from TabControl, then the length of the tab
automatically sizes depending upon the length of the associated Tabpages
Text property. So the answer would be to set the tabpages text property to
the desired string. I am not aware of a way to set the size of individual
tab items.
You can however, set the size of all tabitems by setting the Tabcontrols
SizeMode property to Fixed and then setting the TabControls ItemSize
property.

--
Mick Doherty
http://dotnetrix.co.uk
"Andre Nogueira" <an**@netcabo.p t.NOSPAM> wrote in message
news:ub******** ******@TK2MSFTN GP12.phx.gbl...
hi there.
I am creating a tabcontrol where the drawing of the tabs is controlled by
me.
However, i cannot find a way to change the lenght of the tab.
For instance, "String" needs a smaller tab than a tab which text is "this is a tab with a really really long text".
How can this be done, the changing of the width of the tab?
Thanks!

André Nogueira

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Nov 20 '05 #2
Hum...
The thing is that I wanted to add an icon to each tab page. as such, the
lenght of the icon + the space between text and icon + the lenght of the
text exceeds the width of the tab page...
I'll look into your tip.
Thanks.

André nogueira

"Mick Doherty"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:#P******** ******@TK2MSFTN GP11.phx.gbl...
If you've inherited from TabControl, then the length of the tab
automatically sizes depending upon the length of the associated Tabpages
Text property. So the answer would be to set the tabpages text property to
the desired string. I am not aware of a way to set the size of individual
tab items.
You can however, set the size of all tabitems by setting the Tabcontrols
SizeMode property to Fixed and then setting the TabControls ItemSize
property.

--
Mick Doherty
http://dotnetrix.co.uk
"Andre Nogueira" <an**@netcabo.p t.NOSPAM> wrote in message
news:ub******** ******@TK2MSFTN GP12.phx.gbl...
hi there.
I am creating a tabcontrol where the drawing of the tabs is controlled by me.
However, i cannot find a way to change the lenght of the tab.
For instance, "String" needs a smaller tab than a tab which text is
"this is
a tab with a really really long text".
How can this be done, the changing of the width of the tab?
Thanks!

André Nogueira

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004

Nov 20 '05 #3
Assign an Imagelist to the TabControl. Add the Icon to the Imagelist control
and give the TabPage the relevant ImageIndex. The Tabitem will size itself
accordingly.
--
Mick Doherty
http://dotnetrix.co.uk
"Andre Nogueira" <an**@netcabo.p t.NOSPAM> wrote in message
news:e8******** ******@TK2MSFTN GP12.phx.gbl...
Hum...
The thing is that I wanted to add an icon to each tab page. as such, the
lenght of the icon + the space between text and icon + the lenght of the
text exceeds the width of the tab page...
I'll look into your tip.
Thanks.

André nogueira

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Nov 20 '05 #4
You can try the XTabControl from http://www.springsys.com

Seems this control can achieve what you need.
-Martin
"Andre Nogueira" <an**@netcabo.p t.NOSPAM> wrote in message
news:ub******** ******@TK2MSFTN GP12.phx.gbl...
hi there.
I am creating a tabcontrol where the drawing of the tabs is controlled by
me.
However, i cannot find a way to change the lenght of the tab.
For instance, "String" needs a smaller tab than a tab which text is "this is a tab with a really really long text".
How can this be done, the changing of the width of the tab?
Thanks!

Andr?Nogueira

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1689
by: Tee | last post by:
Hi, Does anyone know how to change an index of an object? This is what I want to do. eg: I have 5 controls in a panel. index from 0 to 4, after I remove the 3rd control (index 2), I want to change the control with index 3 to 2, and 4 to 3. (push up) ... so when I add new control to the panel, the new control will have the index 4.
4
29448
by: Noozer | last post by:
I'm using a tabControl on one of the forms of my MS Access database. The grey bar looks pretty bad on my form. Is there any way to change the colour of the tabs or the tab background for the tabControl in MS Access? I'd even resort to an API call if necessary. Thanks! P.s. Anyone else having problems posting to the Microsoft news server?
3
49436
by: David Rose | last post by:
I would like to catch the tab change before it occurs. There is a SelectedIndexChanged event to catch the change after it occurs. How do I catch when the user clicks on a tab, but before the TabPage changes? Is there anything like the TCN_SELCHANGING notification? TIA David Rose
1
5198
by: Keith Smith | last post by:
How do I change the colors of a tabControl (including the tabs themselves). I only see the option to change the color of each tabPage.
1
1635
by: Danny van Kasteel | last post by:
Hi, I'm trying to make an ownerdrawn ListBox that can display a custom graphic and 2 lines of text per item. I have tried to set the following properties on a standard ListBox control: DrawMode = OwnerDrawFixed ItemHeight = 32
1
1197
by: Danny van Kasteel | last post by:
Hi, I'm having some trouble drawing items in controls that I've marked as ownerdrawn. I'm currently developing an application that has ownerdrawn statusbar panels, and a listbox that contains ownerdrawn items. Both controls behave irratically: The statusbar panels draw fine (the point is to draw an image in them),
10
12045
by: mikl | last post by:
How do you change the overall background color for a tab control (not on each individual tab). I tried Tabcontrol1.Backcolor = System.Drawing.Color.Blue but this did not work. Thanks mikl
1
3466
by: HS1 | last post by:
Hello I can change the background of each page of a TabControl but cannot change the background (BackColor) of this tabcontrol. I did not see it in the properties page. If you know how to change it please help Many thanks SH1
0
2357
by: =?Utf-8?B?TWFydGluIw==?= | last post by:
Hello everybody! Please note that I have posted same question in different forums with no success. So If you tried to help me there, please do not consider the repost as rude! I'm working on an application which has UserControls (GUI pages) with TabControls on it. This TabControls are Usercontrols derived from Windows.Forms.TabControl. Same to TabPage.
0
8189
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
8694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8356
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
8497
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
6118
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
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
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...
1
2621
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
2
1500
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.