GUIDE: Is it possible to write part of a string in a uicontrol objetc in bold?

5 ビュー (過去 30 日間)
Hi there! I was wondering if it's possible in a GUI to have, for example, a pushbutton or a static text with a string that has some of its words in bold. For instance: "this is an example". The FontWeight property set to bold sets all the string in bold, but I just need a part o it. Any comments? Thank you in advance!

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 13 日
編集済み: Walter Roberson 2016 年 7 月 13 日
This is not possible for uicontrol style text or edit, but it is possible for uicontrol style pushbutton, listbox, radiobutton, or popup . For those, the first thing in the String property must be '<HTML>' . After that, put in appropriate HTML3 codes as needed. For example,
'<HTML>Hello, are you having <B>fun</B>?'
You do not need to </HTML>
  2 件のコメント
Bruno Marengo
Bruno Marengo 2016 年 7 月 13 日
Hi Walter, I will try that later and tell you how it goes. Thank you for your time!
Bruno Marengo
Bruno Marengo 2016 年 7 月 13 日
it worked indeed, thanks a lot Walter

サインインしてコメントする。

その他の回答 (1 件)

Hao Cheng
Hao Cheng 2018 年 12 月 18 日
Sadly <HTML> doesn't work with 'text' and 'edit' style.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by