Tab-panel tab text colours

So in an attempt to change the text colour of single tab on a TabPanel, I thought it would be fun to ask ChatGPT to write a code for this (it seems otherwise not possible to change the colours of a tab I believe).

The advice looks real, but Xojo does not know as far as I know something like a TabPanelStyle, right?

Dim tab As Integer = 0 // The index of the tab you want to change the color for
Dim color As Color = &cFF0000 // The color you want to use

// Get the style for the tab panel
Dim style As TabPanelStyle = StartHub.TabPanelStyle

// Get the style for the tab you want to change
Dim tabStyle As TabPanelTabStyle = style.Tab(tab)

// Set the text color for the tab
tabStyle.TextColor = color

// Apply the new style to the tab panel
DesktopTabPanel1.TabPanelStyle = style

The starting screen background of my app is dark and the tab text is not easy to read at this moment, so it would be nice to give the non selected tab a brighter colour:

Try Trixis TabPanels from my website at Xojo + Alfred. Multiple styles, everything done in code. You can easily change the colors.

If your app is macOS only, it’s possible to tell a view to be always in dark mode using declares if that would help.

Try running your application under Windows (hint: prepare yourself to cry when you watch the screen)…

Thanks, but it seems to use a plugin I don’t have.

Thanks, that’s a good suggestion. It looks good in Dark mode. Would be nice still if it would also look good in Light mode. And I probably only will build for MacOS, because I don’t own a Windows machine myself.

There is only one call to MBS to get the default font size.

:slight_smile: :joy:

right, my point is that we could make that view always show in dark mode, regardless of the system setting. That’s what the IDE does when you toggle the light/dark mode button.