Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:54:25+00:00 2026-05-11T07:54:25+00:00

I am trying to update an old VB6 application. I am struggling with changing

  • 0

I am trying to update an old VB6 application. I am struggling with changing the backcolor of the SSTab control at runtime.

I know that I cannot just set the Backcolor to the required colour.

At designtime I have created a label on each tab and then resized the label to the sstab dimensions. Then I set the label backcolor. This works fine.

However, what I really want to do is to do this at runtime so that if a new tab control is added on a form in the future I dont need to manually do this at designtime each time.

I would be grateful if someone can point me in the right direction to create and display a label on every tab of a SSTab control at runtime?

I dont have frames on all the tabs so I dont want to use the frame container to hold the label. I would rather just have the label placed on the tab container at runtime.

Thanks and I look forward to your replies.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:54:26+00:00Added an answer on May 11, 2026 at 7:54 am

    As svinto says, you can load new controls to a Control Array, but there’s a bit more to it than that.

    Firstly the new controls are not Visible, so you must set .Visible=True You also need to set the current tab before creating the control to get it sited on that tab.

    Assuming you already have the first label on the first tab:

    For i = 1 To Me.SSTab1.Tabs - 1     Me.SSTab1.Tab = i     Load lblOne(i)     lblOne(i).Visible = True Next 

    Also, this doesn’t work in the Form_Load event, but does in Form_Activate

    There is another method to create the Labels from scratch rather than using a Control Array, which might be better as you don’t need to add the first Label to the form:

    Private Sub Form_Activate()     Dim lbl() As Label     Dim i As Integer     Dim name As String     ReDim lbl(SSTab1.Tabs - 1)    For i = 0 To Me.SSTab1.Tabs - 1         Me.SSTab1.Tab = i         name = 'MyLabel' & CStr(i)         Set lbl(i) = Form1.Controls.Add('VB.Label', name)         Set lbl(i).Container = Me.SSTab1         lbl(i).Visible = True         lbl(i).Caption = name         lbl(i).Move 40, 345         lbl(i).BackColor = vbGreen     Next End Sub 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use an old Powerbook G4. While trying to update the macports (sudo port
I have an old VB6 app which I'm still trying to support. A few
I'm trying to update my old Android app to work correctly on Android 4.0.
I'm brand new to Firefox extensions and am trying to update an old extension
I'm trying to use a trigger function to update old records in the same
I'm trying to update a cell in jqgrid permanently upon loading. I know I
I'm trying to update an old Access database using SQL scripts, but I can't
I am trying to change some old code which uses onclick so that I
I am trying to update an old cms where images were stored in /images/editor/,
I'm trying to update to an old revision, but I'm getting: $ svn update

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.