Effacer les filtres
Effacer les filtres

Is it possible to change the tab color and font of a uitabgroup's tabs?

48 vues (au cours des 30 derniers jours)
matlabuser77
matlabuser77 le 15 Déc 2023
Commenté : Graham Cotgreave le 25 Juil 2024
Is it possible to change the color of a uitabgroup's tabs as well as the font and font color? If not, is it possible to adjust the border color of the uitabgroup?
It is possible to change the background color of each tab's pane, but I do not see a way to adjust the color or font/font color of the bar or the tab name elements on it. I am on R2023b.

Réponses (1)

atharva
atharva le 15 Déc 2023
Hey matlabuser77,
I understand that you want to know if it is possible to change the color of a uitabgroup's tabs as well as the font and font color and If not, is it possible to adjust the border color of the uitabgroup.
Yes, it is possible to adjust the border color of a uitabgroup in MATLAB. You can use the 'BorderType' property to set the type of border and the 'BorderColor' property to set the color of the border. Here's an example:
h = uitabgroup;
set(h, 'BorderType', 'line', 'BorderColor', 'red');
You can use the 'ForegroundColor' and 'BackgroundColor' property to change the font color the tabs respectively.
You can go through the official Mathworks documentation below to understand more about 'ForegroundColor'
You can change the font and font size for the title of a uitab by using the HTML formatting inside the "Title" property of the uitab. Here's an example to set the font size and font of a uitab to "12" and "Helvetica" respectively using HTML formatting:
>> tabGroup = uitabgroup(f);
>> % Use HTML formatting to specify font size
>> tab = uitab(tabgp, 'Title', '<html><font size="12">Tab 1</font></html>');
>> % Use HTML formatting to specify font face
>> tab = uitab(tabGroup, 'Title', '<html><font face="Helvetica">Tab 1</font></html>');
I hope this helps!
  1 commentaire
Graham Cotgreave
Graham Cotgreave le 25 Juil 2024
Is there anyway to achieve the same effect when running a MatLab app directly from MatLab or as a Windows compiled app, in 2022b? The trick above does not appear to work.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Produits


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by