Guest shelly21 Posted June 23, 2002 Posted June 23, 2002 I'm having a slight issue trying to figure out how to change the font size within a lbl.box within the program. The box will display some text depending on which button is pressed. And certain button produces a longer text that would not fit (well) in the label box. So when I try to use lblbox.text.font.size = 8, It doesn't work as that property is ReadOnly. I could change the font colour easily, but not font size.... Is there another way to do this? :confused: Quote
Guest Agent Posted June 23, 2002 Posted June 23, 2002 ' EDIT I see your using .NET. Sorry buddy! ;) It works fine for me! I used: Option Explicit Private Sub Form_Load() Label1.Font.Size = 18 End Sub Quote
*Gurus* divil Posted June 23, 2002 *Gurus* Posted June 23, 2002 Take a look at the Font class constructor. One of the methods is to specify a base font and a new size, so doing something like this: Label.Font = New Font(Label.Font, 18) Ought to do it for you. Something like that anyway. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Guest shelly21 Posted June 23, 2002 Posted June 23, 2002 That did it. Strangely I had the solution in my dream last night. Not the actual solution but I was dreaming about looking at the init. section to see how the label box was created in the first place. Scary isn't it? :) Quote
*Gurus* divil Posted June 24, 2002 *Gurus* Posted June 24, 2002 I reckon when you dream about code, that means you're spending far too much time coding ;) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.