Is it possible to change the tab color and font of a uitabgroup's tabs?
45 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
atharva
on 15 Dec 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!
2 Comments
Graham Cotgreave
on 25 Jul 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.
See Also
Categories
Find more on Develop uifigure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!