Results 1 to 3 of 3

Thread: Changing font properties on a label control ... um, help?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Balmer
    Posts
    10

    Unhappy Changing font properties on a label control ... um, help?

    I didn't think this was going to be such a freakin' issue. I want to be able to change the font size on a label after getting input from another form. I've already handled all of the activation issues - but I can't for the life of me figure out how to change the font properties on the label. Do I just need to destroy the one that's there and make a new one?

    All of the .font properties are read-only. Where the heck do I *set* the damn things?

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    VB Code:
    1. Dim f As New Font("arial", 16)
    2.         Label1.Font = f
    This world is not my home. I'm just passing through.

  3. #3
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Better still...

    VB Code:
    1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    2.  
    3.         Dim str As String = Label1.Font.Name
    4.         Dim size As Integer = Label1.Font.Size
    5.  
    6.         Dim f As New Font(str, size + 1)
    7.         Label1.Font = f
    8.  
    9.     End Sub
    This world is not my home. I'm just passing through.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width