MATLAB Answers

Underline Text in Gui

26 views (last 30 days)
nsbd on 6 Feb 2012
Commented: Ralph on 28 Oct 2020
Hi All
N.Class = uicontrol('unit','pix',...
'position',[0 405 340 30],...
'fontwei','normal',... ****underline ???
'backg',[0 0 0],...
How do I ?

Answers (2)

Jan on 6 Feb 2012
See Yair's suggestion about customizing buttons.
H = uicontrol('Style', 'PushButton', ...
'String', '<u>Underline</u>');
  1 Comment
Ralph on 28 Oct 2020
For anyone reading this in 2020 (or perhaps other versions):
You need to include the <html> tags in the string for this mechanism to work. So its:
H.String = '<html><u>control label</u></html>';

Sign in to comment.

Sean de Wolski
Sean de Wolski on 6 Feb 2012
text(3,10,'\underline{Hello World}','interp','latex')
axis([0 20 0 20])
I can't seem to find a way to to this for a uicontrol string, though I'm sure there is a way.

Community Treasure Hunt

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

Start Hunting!

Translated by