i binding listboxitems arraylist.this arraylist contains textbox , combobox text.now question how can make 1 listitem font bold through code not xaml..because not adding listbox items xaml.
any suggestion, idea implement this..
thanks in advance.
edit:
xaml:
<listbox name="lstbx" width="200" horizontalalignment="left" margin="0,0,0,0" borderbrush="transparent" > </listbox>
code:
private arraylist loadlistdata() { arraylist arrlist = new arraylist(); //txtfullname.fontweight = fontweights.bold; //this didnt work arrlist.add(txtfullname.text); arrlist.add(" "); } lstbx.itemssource=loadlistdata();
i don't know if want i'm filling listbox textblocks , setting text content want. demonstration:
private void makebold() { (int = 0; < 5; i++) { textblock s = new textblock(); s.text = "testing" + i; if (i == 3) s.fontweight = fontweights.heavy; lstbx.items.add(s); } }
i result:
i hope helps.
Comments
Post a Comment