Setting font of parent in nodes in WPF Tree View to Bold using code behind

后端 未结 3 814
青春惊慌失措
青春惊慌失措 2021-01-25 19:09

I have made a tree view and added parent and child nodes to it all using code behind, now where I am stuck is to set the font of parent nodes to BOLD while keeping

3条回答
  •  迷失自我
    2021-01-25 19:22

    You need to put something like this:

    tb.SetValue(TextBlock.FontWeightProperty, FontWeights.Bold);
    

    or

    tb.SetValue(TextBlock.FontWeightProperty, FontWeights.Normal);
    

    wher you see fit

提交回复
热议问题