Listbox
-
How do you change the Font.Bold property on a listbox in code? Check out my websites: BugTrak Project Home The New Space The Simple Read
-
How do you change the Font.Bold property on a listbox in code? Check out my websites: BugTrak Project Home The New Space The Simple Read
Well, the Font property is read/writable. But, once created, the Font is immutable. You can't modify it. What you have to do is create a new Font object and assign it to the
ListBox.Font
property. But, you can create a new Font by using an existing one and modifying the parameters as you do so:ListBox1.Font = New Font(ListBox1.Font, ListBox1.Font.Style Or FontStyle.Bold)
RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Well, the Font property is read/writable. But, once created, the Font is immutable. You can't modify it. What you have to do is create a new Font object and assign it to the
ListBox.Font
property. But, you can create a new Font by using an existing one and modifying the parameters as you do so:ListBox1.Font = New Font(ListBox1.Font, ListBox1.Font.Style Or FontStyle.Bold)
RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
is there a way to change the bold property on a single item? Check out my websites: BugTrak Project Home The New Space The Simple Read
-
is there a way to change the bold property on a single item? Check out my websites: BugTrak Project Home The New Space The Simple Read
Not through properties. It's all or nothing. The only way to do it is if you were to owner-draw the control. This will give you the ability to draw each item individually, and in the process, change its font. Search the articles for "custom listview" and you'll find examples of owner-drawing the ListView control. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome