Listviewitem font set to bold

  • Thread starter Thread starter Alan T
  • Start date Start date
Alan T said:
How do I set a particular listview item text to bold?


Well, if you are adding it to a listview called lstView:

ListViewItem NewItem = new ListViewItem();
NewItem.Text = "foo";
NewItem.Subitems.Add("bar");
NewItem.Font = new Font(lstView.Font, FontStyle.Bold);
lstView.Items.Add(NewItem);

You should be able to also use the font line referencing an item in the list
view items collection... something like

lstView.Items[idx].Font = new Font(lstView.Font, FontStyle.Bold);

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top