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

Problems with the display of the tabs in my customized TabControl

I want to change the the color of the tabs and the color of TabControl
itself in a TabControl. Therefore I wrote the following code in my
customized TabControl-class:

this.DrawMode = TabDrawMode.OwnerDrawFixed;

protected override void OnDrawItem(DrawItemEventArgs e)

{

e.Graphics.FillRectangle(new SolidBrush(Color.Gray), this.ClientRectangle);

for(int i = 0; i < this.TabCount; i++)

{
Rectangle currentPage = this.GetTabRect(i);

e.Graphics.FillRectangle(new SolidBrush(Color.Green), currentPage);

e.Graphics.DrawString(this.TabPages[i].Text, e.Font, new
SolidBrush(mTabFontColor), currentPage, StringFormat.GenericDefault);

}
}

It changes the colors correct, but the problem is, that the tabs aren't
shown correct (especially if appearence = Button is selected, than it
sometimes draws a normal rectangle instead of an unselected button ).

Does anybody have an idea how I could change the color of the tabs and also
the color of the tabControl itself in a proper way?

I know about "dotnetmagics", but I am not willed to purchase it, because I
think there has to be a different way of implementing this comparative
simple task.

Nov 16 '05 #1
0 853

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

Similar topics

1
by: Paiam Salavati | last post by:
I want to change the the color of the tabs and the color of TabControl itself in a TabControl. Therefore I wrote the following code in my customized TabControl-class: this.DrawMode =...
3
by: rossum | last post by:
I have a TabControl with a lot of tabs in it. Since it is sometimes difficult to tell which tab is currently active (all the pages have the same layout) I want to be able to highlight which tab is...
4
by: Randy | last post by:
I'm writing an application where the user interface has many tabs, and sets of tabs within each tab (customer requirement). Each subtab has a great number of it's own controls and functions. Rather...
4
by: Alberto | last post by:
How can I do to show the tabs in a TabControl in the botton of the control? Thank you.
2
by: michael sorens | last post by:
After extensive searching of the docs, I find no mention of support for Ctrl-Tab and Ctrl-Shift-Tab to navigate among tabs in a TabControl. I am surprised that such a common/standard keyboard...
3
by: Jean Paul Mertens | last post by:
Hello, Is there a way to change the background color of the tabs in a tabcontrol (there where the name of the tab is and where you click to change to an other tab) I don't see any property or...
0
by: samadams_2006 | last post by:
Hello, I have a VB.NET Form which has a System.Windows.Forms.TabControl on it. This TabControl has 5 Tabs on it. On each tab, I have various textboxes, option boxes, radio boxes, etc. I would...
8
by: M K | last post by:
How do you hide individual tabs? I have tried .Hide() but it hides them all? Mark
4
by: hariadusumalli | last post by:
Hi, I added a tab control to my form. I need to add the tab pages to the control at run-time. But this is little different from the normal way. I need to display one specific tab to the right...
7
by: roundcrisis | last post by:
Well basically i need to have a tab control but not show the actual tabs how to? there doesnt seem to be any property to do this either in teh tab control nor in each tab Cheers
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
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
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
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,...

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.