Underline Text in Gui

15 次查看(过去 30 天)
nsbd
nsbd 2012-2-6
评论: Ralph 2020-10-28
Hi All
N.Class = uicontrol('unit','pix',...
'style','text',...
'position',[0 405 340 30],...
'string','Hello',...
'horizon','center',...
'fontwei','normal',... ****underline ???
'FontName','Verdana',...
'backg',[0 0 0],...
'fontsize',8);
How do I ?
Thnks.

回答(2 个)

Jan
Jan 2012-2-6
See Yair's suggestion about customizing buttons.
H = uicontrol('Style', 'PushButton', ...
'String', '<u>Underline</u>');
  1 个评论
Ralph
Ralph 2020-10-28
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>';

请先登录,再进行评论。


Sean de Wolski
Sean de Wolski 2012-2-6
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.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by