How do you make the text in a ComboBox appear larger

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 6 years, 5 months ago.

  • Author
  • #6063

    by graybin at 2013-03-27 10:33:29

    No matter what I change the font size or box size to, the size and font don't seem to change. How can I change it so the text is larger?

    $Font = New-Object System.Drawing.Font("Microsoft Sans Serif",16,5,3,1)
    $Rights = New-Object System.Windows.Forms.ComboBox
    $Rights.DataBindings.DefaultDataSourceUpdateMode = 0
    $Rights.BackColor = [System.Drawing.Color]::FromArgb(255,4,89,170)
    $Rights.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",7,0,3,0)
    $Rights.ForeColor = [System.Drawing.Color]::FromArgb(255,255,215,0)
    $Rights.FormattingEnabled = $True
    $System_Drawing_Point = New-Object System.Drawing.Point
    $System_Drawing_Point.X = 20
    $System_Drawing_Point.Y = 40
    $Rights.Location = $System_Drawing_Point
    $Rights.Name = "Rights"
    $System_Drawing_Size = New-Object System.Drawing.Size
    $System_Drawing_Size.Height = 60
    $System_Drawing_Size.Width = 500
    $Rights.Size = $System_Drawing_Size
    $Rights.Items.Add("Default") | Out-Null
    $Rights.Text = "Default"

    by poshoholic at 2013-03-27 12:08:45

    Wait, at the top you're creating a new System.Drawing.Font object with one size, and then on line 5 you're assigning a different, much smaller font to the ComboBox you have created. Try replacing line 5 with this:
    $Rights.Font = $Font

    by graybin at 2013-03-28 04:59:07

    Duh, thanks

You must be logged in to reply to this topic.