Link to home
Start Free TrialLog in
Avatar of John Gates, CISSP, CDPSE
John Gates, CISSP, CDPSEFlag for United States of America

asked on

Change the color of the sstab control

How can I change to color of the sstab control in .NET?
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

The question is why are you using the ssTab contol in .Net. You would be better using the TabControl that comes with .Net.

See an article I wrote about it in May 2004 at http://emoreau.s2i.com/

Also have a look at Mike Dohertys' TabControl at http://dotnetrix.co.uk/tabcontrols.html
Avatar of John Gates, CISSP, CDPSE

ASKER

No the question is:

How can I change to color of the sstab control in .NET?

I converted a project from VB6 to .NET this is my first attempt at .NET so can you help me?  Can you change the color or do I have to use the newer control?

-D-
You should not use VB6 controls into .Net because they have to use COM interop to access COM objects. You should really rely on real .Net controls. That's why I suggested these 2 links.
Can you change the background color of the sstab control?
Of the tab itself (at the top of the tabpage) or the page?

are you able in VB6?
The top of the tab page.  In vb6 the top of the tab page assumed the tab pages background.  In .NET that is not the case.  I know I am going to need to do a lot of converting to make this a true .NET app but I need to crawl before I walk with this.  I am a long time ASP , VB , and Java programmer..  .NET is pretty tough.  I am actually having better luck with C#  but this app is big so it needs to stay VB.  Thanks for your help so far.

-D-
I just reopened VB6 to test the control. It doesn't have the feature to change the background color.

But have a look at http://www.vbcity.com/forums/topic.asp?tid=458
Wow I thought this was going to be an easy one...  Wow well points go to 500.

Walk me through the .NET tab control using the TabControlEX.dll in .NET

Let me know step by step how to get the control to work.


You know the one listed in that site you posted..
a much simpler way to start. Use a plain TabControl and go :
http://www.vb-tips.com/default.aspx
then click Windows Controls (in the left margin)
then select "tabcontrol Change Color of a Tab" from the combo
I don't want the tab to change color...  I just want the background of the control to match the page color...  in this case grey..  I thought .NET was supposed to make things easier....
>>I just want the background of the control to match the page color

I don't understand which part of the TabControl/TabPage you mean.

>>I thought .NET was supposed to make things easier....

It is for some things. It isn't for other!
in VB6 when you put the sstab control in a form the tabs were standard windows colors and the background was the color of your pages.

In .NET my tabs are the standard color... but behind the tabs is also the standard grey color (About 1/2 inch in height)  It looks horrible.  Does this make sense?
do you mean the space to the right of all tabs? In this case, have a look at "A Completely OwnerDraw TabControl." from http://dotnetrix.co.uk/tabcontrols.html
I have looked at those articles and it is not working.  There is no color choice.  If you know how to do this I need a step by step....  I am really starting to hate .NET  I may just stay with VS6 for a while more...
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will try this tonight and the points are yours if it works.  Will .NET be smart enough to let me know I need to package that dll with the program to deploy it? 8)

Yes. It can be deployed in the same folder as your own .exe.
any news here ?
Have not tried it yet..  In the middle of a big system migration.  Will try tonight and post.
Hmm..  Well it comes into the toolbox as you said but when I try to compile when I add it to a project:

D:\DimanteArena\Arena\Dot NET Conversion\IceLogNT.NET\IceOrders.vb(3689): Name 'TabControl1' is not declared.

Ahh VB6 was so much easier than this...... sigh
to test it, you should really use a small application. Test it to see it it is working like you want before introducing it in your larger project.

I suspect that TabControl1 is a previous control you add to your form and that you have deleted.

>>Ahh VB6 was so much easier than this

I do not agree. VB.Net is really different. It is not the VB you used to work with before. It is a lot more complex and can do a lot more.
I never had a tabcontrol object just the sstab.
Ahh I see what happened and this tab control does exactly what I was looking for.  I know .NET can do a lot more but I am afraid that .NET 2.0 is gonna force me to learn all over again...  I hope it stays to the original .NET 1.0 parameters...  Also you say .NET can do more but yet it seems like the only way you can display data is with a datagrid object.  That does not seem right...
>>Ahh I see what happened and this tab control does exactly what I was looking for.

Good news.

>>I know .NET can do a lot more but I am afraid that .NET 2.0 is gonna force me to learn all over again...

No. Going from VS2002/2003 to 2005 is painless.

>>Also you say .NET can do more but yet it seems like the only way you can display data is with a datagrid object.  

You can bind almost any controls!
Well good I still have not gotten VS .NET 2005 MSDN yet but I might as well dive right in when it comes LOL.

Thanks for the help

-D-