Notifications
Clear all

[Closed] DotNet Listview : Make line BOLD

I’ve been frustrated by something simple I’m just not getting…

I’ve a dotNetObject:System.Windows.Forms.ListViewItem with a non-changable property .font.bold

How do I construct this item, so I can change the prop to BOLD?

Thanks

3 Replies

assign a new font to the item


newFont = dotNetObject "System.Drawing.Font" \
	"Microsoft Sans Serif" \ -- font name
	11 \ -- font size (in piels)
	(dotNetClass "System.Drawing.FontStyle").Bold \ -- font style (bold)
	(dotNetClass "System.Drawing.GraphicsUnit").Pixel -- specify size is in pixels
listview_rollout.lv_objects.items.item[0].font = newFont

See also: http://msdn2.microsoft.com/en-us/library/system.drawing.font.aspx

oh…
MyComputer.MyOperatingSystem.WillyWonka.Chocolate.MicroSoft.Application.Subsystem.System.Drawing.FontStyle.
I shouldv’e known… Thanks

lol, yes

Actually, the biggest bit is “assign a new font”. Once you realize that bit, the question becomes “so how the heck do I make a new font?”, and Google becomes your friend

I agree that it’s weird that you can’t just change the .bold property to true; but that’s .NET for ya