473,326 Members | 2,061 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,326 software developers and data experts.

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 6231
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.pt.NOSPAM> wrote in message
news:ub**************@TK2MSFTNGP12.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.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:#P**************@TK2MSFTNGP11.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.pt.NOSPAM> wrote in message
news:ub**************@TK2MSFTNGP12.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.pt.NOSPAM> wrote in message
news:e8**************@TK2MSFTNGP12.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.pt.NOSPAM> wrote in message
news:ub**************@TK2MSFTNGP12.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
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...
4
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...
3
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...
1
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
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: ...
1
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...
10
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
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.