bjwade62 Well-known member Joined May 25, 2006 Messages 50 Programming Experience 3-5 Oct 11, 2006 #1 Anyone know why Label.font.size and Label.font.bold are read only at runtime in .NET? Is there a work around?
Anyone know why Label.font.size and Label.font.bold are read only at runtime in .NET? Is there a work around?
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,800 Location Norway Programming Experience 10+ Oct 11, 2006 #2 Create a new font from the old, changing the properties you need, assign this new font. Font contructor is overloaded for many possibilities. VB.NET: [SIZE=2]Label1.Font = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Font(Label1.Font.FontFamily, 10)[/SIZE] Upvote 0 Downvote
Create a new font from the old, changing the properties you need, assign this new font. Font contructor is overloaded for many possibilities. VB.NET: [SIZE=2]Label1.Font = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Font(Label1.Font.FontFamily, 10)[/SIZE]