PDA

View Full Version : DotNet Listview : Make line BOLD


Kramsurfer
04-25-2008, 01:24 AM
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

ZeBoxx2
04-25-2008, 02:45 AM
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

Kramsurfer
04-25-2008, 06:43 AM
oh..
MyComputer.MyOperatingSystem.WillyWonka.Chocolate.MicroSoft.Application.Subsystem.System.Drawing.FontStyle.
I shouldv'e known.... Thanks :-)

ZeBoxx2
04-25-2008, 10:51 AM
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

CGTalk Moderation
04-25-2008, 10:51 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.