Solved

SS Tab Caption

Posted on 1997-12-25
3
300 Views
Last Modified: 2008-02-01
Hi all,

I'm using VB 4 and on my form I have an SS tab with 6 tabs. I've set all the caption titles of the tabs to be the colour black however I want to make it so that when I run my program and click on one of the tabs it changes colour. For exmaple, lets says my tab titles are: tab1, tab2, tab3....etc and they're all black, however if i clicked on the tab titled tab2 the colour of the caption should change from black to red and then when I click on tab3, tab2 should change back to black and the caption of tab3 should become red and so on.

This is the code I have come up with:

Private Sub SSTab1_Click
SSTab1.ForeColor = &HFF&

However that changes ALL the tab labels to red where as I only want the active tab to have a red caption. Can anyone help?

Thanx
Belle
0
Comment
Question by:Belle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 50 total points
ID: 1447326
You can calculate the position of the text manualy and print the text manualy using TextOut. This will allow you to use any color
0
 

Author Comment

by:Belle
ID: 1447327
I don't quite know how to do that.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1447328
Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long
Declare Function SetTextColor Lib "gdi32" Alias "SetTextColor" (ByVal hdc As Long, ByVal crColor As Long) As Long

Dim hDC as long
hDC = GetDC(sstab.hwnd)
SetTextColor(hdc, RGB(255,0.0)) 'Red Color
TextOut(hdc, x, y, "Caption", len("Caption"))


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question