Notifications
Clear all
[Closed] Dotnet fonts
Oct 21, 2008 11:31 pm
Hi, Im trying to set a list view item to bold and italic. I can do one or the other but am not sure how to set both styles.
Cheers
1 Reply
Oct 21, 2008 11:31 pm
System.Drawing.Fontstyle is an enumerated type, so you have to use dotnet.combineenums to ‘or’ its bits.
myForm = dotnetobject "form"
myLabel = dotnetobject "label"
FStyleClass = dotnetclass "system.drawing.fontstyle"
boldItalic = [b]dotnet.combineenums[/b] FStyleClass.italic FStyleClass.bold
myFont = dotnetobject "system.drawing.font" mylabel.font boldItalic
myLabel.font = myFont
myLabel.text = "Bold Italic"
myForm.controls.add mylabel
myForm.show()