treeview - Want to bold few characters of a word get bold in treenode in winforms using c# -


i have "search textbox" search in treeview, give result well. want parts bold typed in "search textbox" of winform.

ex: typed ram gives *ram*esh .

the treenode class doesn't support that, text drawn 1 font, treeview.font. making parts of text bold technically possible hard right. need enable custom drawing treeview.drawmode property , drawitem event, there's example of in msdn library article.

that's easy part, hard problem node small fit text after draw parts of in bold font. treeview missing "measurenodetext" event allow ask enough space. workaround lie node text , make artificially wider prefixing characters. don't draw in drawitem event. hard consistently right, you'll want consider fixed pitch font instead.

i cannot recommend pursue unless feature important you. otherwise explains why never see feature in other programs. consider changing color instead of font weight too. still hard glue pieces btw.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -