I can't get bold font in uitable app designer
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
app.UITable_periodical.Data
s = uistyle;
s.FontWeight = "bold";

if i set s.FontWeight = "bold" or not is equal..i don't see character bold
採用された回答
Voss
2023 年 8 月 15 日
To make a uistyle take effect, you must use addStyle to associate the style with the component (i.e., the uitable in this case).
% create a uistyle:
s = uistyle; % these two line could more succinctly be written as
s.FontWeight = "bold"; % s = uistyle('FontWeight','bold');
% associate s with a uitable:
addStyle(app.UITable_periodical,s)
7 件のコメント
aldo
2023 年 8 月 15 日
sorry I posted I text partially because there were other conditions.. I wrote this in the code:
[app.UITable_periodical.Data,idxNeg,idxPos]=Table_Periodical_Struct(app.Eq,app.PeriodicalDropDown.Value);
app.UITable_periodical.ColumnName = {'Day','P&L','Month','P&L','Year','P&L'};
s = uistyle;
s.FontWeight = "bold";
s.FontColor='red';
addStyle(app.UITable_periodical,s,'cell',idxNeg);
s.FontColor=[0 0.5 0];
addStyle(app.UITable_periodical,s,'cell',idxPos);
Voss
2023 年 8 月 15 日
How are idxNeg and idxPos defined?
aldo
2023 年 8 月 15 日
are coordinated to color the boxes
[row,column]=find(prof<0);
column=column+1;
idxNeg=[row,column];
[row,column]=find(prof>0);
column=column+1;
idxPos=[row,column];

Voss
2023 年 8 月 15 日
Looks like it's working. Positive and negative values are bold, positive values in green and negative in red. Right?
ah :D
I wanted to make each word/number bold regardless of whether it was colored
I extended the bold only to the colored numbers :(
Voss
2023 年 8 月 15 日
Ah, ok. You can make everything bold in a couple of different ways. I would probably make a new uistyle just for the bold FontWeight, and apply it everywhere (e.g., every column) you want to be bold. And let the color uistyles be just for FontColor and apply only to specific cells. (Any row/column/cell can have multiple uistyles applied to it.)
I'm sure you can get it from here, but if you need any help, let me know.
aldo
2023 年 8 月 15 日
oky thank you
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Develop Apps Using App Designer についてさらに検索
参考
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
