Share via

How to Migrate VB.NET WinForms App from AxTabDlg.AxSSTab (Sheridan SSTab ActiveX) to 64-bit Managed Controls?

Aman Agrahari 180 Reputation points
2025-12-29T06:25:24.8933333+00:00

Hello Community,

I’m working on migrating a VB.NET Windows Forms application from 32-bit ActiveX controls to a pure 64-bit managed solution. The app currently uses Sheridan SSTab ActiveX via AxInterop.TabDlg (e.g., AxTabDlg.AxSSTab). Since ActiveX/COM controls cannot load in a 64-bit process, I need to replace SSTab with managed WinForms controls like TabControl and ToolStrip.

How to migrate the
event handlings like: ClickEvent, etc
Functions like:
tab.set_TabPicture(iIndex, imgobj1)
tab.set_TabCaption(iIndex, "")
tab.get_TabVisible(liCounter)
tab.set_TabVisible()

Specific Questions

  • What is the best way to track previous tab index in TabControl (since e.previousTab doesn’t exist)?
  • How do I hide/show tabs dynamically? Is removing/inserting TabPage the recommended approach?
  • For disable tab selection, is handling Selecting and setting e.Cancel = True the correct pattern?
  • For images and custom text on tabs?
  • For 'OcxState' is not a member of 'TabControl'?
  • Can I achieve this by using VB.NET Extension Methods?
  • For example, creating extension methods on System.Windows.Forms.TabControl that mimic SSTab’s API so I don’t have to rewrite all call sites.
    • Will this approach work seamlessly for methods like:
    • set_TabVisible(index, bool) → hide/show tabs
    • get_TabVisible(index) → check visibility
    • set_TabCaption(index, caption) → set tab text
      • set_TabPicture(index, image) → set tab icon using ImageList

Any guidance, sample code, or migration tips would be greatly appreciated! If you’ve done this migration before, please share your approach for handling custom styles and SSTab-specific features.

Thanks in advance!

Developer technologies | .NET | .NET Runtime
0 comments No comments

2 answers

Sort by: Most helpful
  1. Varsha Dundigalla(INFOSYS LIMITED) 4,785 Reputation points Microsoft External Staff
    2025-12-29T12:49:17.3566667+00:00

    Thanks for reaching out.

    When moving from Sheridan SSTab (AxTabDlg.AxSSTab) to managed WinForms controls like TabControl, the behavior changes because SSTab is an ActiveX control and TabControl is a native WinForms control. There is no one‑to‑one API replacement, but the same behaviors are handled in different ways.

    The TabControl does not expose a “previous tab” property like SSTab. The previous tab is known during the tab change process itself, so it needs to be tracked when the user switches tabs.

    WinForms does not support hiding a tab header the same way SSTab does with TabVisible. The supported WinForms approach is to remove a TabPage from the TabPages collection to hide it, and add it back when it should be shown.

    Blocking or controlling tab switching is not done with click events in TabControl. Instead, tab changes are handled during the selection process, where the tab change can be allowed or canceled. This replaces SSTab’s click‑based logic.

    Tab text and images are supported in TabControl, but through different properties. The tab caption comes from the TabPage text, and images are handled using an ImageList associated with the TabControl, instead of SSTab properties like TabPicture.

    The OcxState property does not exist on TabControl because it is only used for ActiveX controls hosted via AxHost. Since TabControl is a fully managed WinForms control, OcxState is not applicable, and its absence is expected.

    In summary, this migration is about re‑implementing SSTab behavior using standard WinForms patterns rather than translating ActiveX properties directly.

    Please let us know if you require any further assistance, we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer". So that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.


  2. Q&A Assist
    2025-12-29T06:25:38.4233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Migrating from ActiveX controls like Sheridan SSTab to managed WinForms controls such as TabControl involves several steps and considerations. Here’s a breakdown of how to approach your migration:

    1. Tracking Previous Tab Index: Since TabControl does not provide an e.previousTab property, you can maintain your own variable to track the previously selected tab. For example:
         Private previousTabIndex As Integer = -1
         
         Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
             Dim currentTabIndex As Integer = TabControl1.SelectedIndex
             ' Use previousTabIndex as needed
             previousTabIndex = currentTabIndex
         End Sub
      
    2. Hide/Show Tabs Dynamically: You can hide/show tabs by removing or adding TabPage instances to the TabControl. To hide a tab, you can remove it from the TabPages collection:
         TabControl1.TabPages.Remove(TabPageToHide)
      
      To show it again, simply add it back:
         TabControl1.TabPages.Add(TabPageToShow)
      
      This approach is straightforward and keeps your UI responsive.
    3. Disabling Tab Selection: To prevent users from selecting a tab, handling the Selecting event and setting e.Cancel = True is indeed the correct pattern. This will stop the tab from being selected when the event is triggered:
         Private Sub TabControl1_Selecting(sender As Object, e As TabControlCancelEventArgs) Handles TabControl1.Selecting
             If ShouldCancelSelection Then
                 e.Cancel = True
             End If
         End Sub
      
    4. Images and Custom Text on Tabs: You can set images and custom text on tabs by using the ImageList property of the TabControl. First, create an ImageList, add your images, and then assign it to the TabControl:
         TabControl1.ImageList = myImageList
         TabControl1.TabPages(0).ImageIndex = 0 ' Set image for the first tab
         TabControl1.TabPages(0).Text = "Custom Text"
      
    5. Handling OcxState: The OcxState property is specific to ActiveX controls and does not exist in TabControl. You will need to manually handle any state management that was previously managed by the ActiveX control. This may involve saving the state of the selected tab or any other relevant data in your application logic.

    By following these guidelines, you can effectively migrate your application from using ActiveX controls to a fully managed solution using WinForms controls. Make sure to test thoroughly to ensure that all functionality is preserved during the migration.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.