Can't Turn Off BOLD in ListView

  • Thread starter Thread starter Larry Re
  • Start date Start date
L

Larry Re

I have an app that contains a ListView box with columns (details view). I
have no problem changing the text of any one line of text to Bold. I
accomplish this using:

lvMainList.Items[Counter - 1].Font = new Font(lvMainList.Items[Counter -
1].Font, lvMainList.Items[Counter - 1].Font.Style | FontStyle.Bold);

My problem is I can't set the FonStyle back to Regular. I have tried
everything I can think uof (see code below) and although it compiles without
errors the fontstyle remains Bold.

Tried this:
lvMainList.Items[Counter - 1].Font = new Font(lvMainList.Items[Counter -
1].Font, lvMainList.Items[Counter - 1].Font.Style & FontStyle.Regular);

And This:

lvMainList.Items[Counter - 1].Font = new Font(lvMainList.Items[Counter -
1].Font, FontStyle.Regular);

Can anyone help?
 
Try saving the unbold font in some font object, and using that font instead
of making a new font every time you change the bold style.

Chris
 
Back
Top