Change Font.Size

  • Thread starter Thread starter Bjoern
  • Start date Start date
B

Bjoern

Hi all,
how can i change the Font Size of the Text in my Label.
I will change it dynamic in the code.
I tryed:
int number = 11;
label1.Font.Size = number;
But this is not possible because Size is Write-Protected.
There is only a Get-Method and no Set.
Plz Help
 
Hello,
Although, the Size property is read-only, the Font property itself is not.
Therefore, you can change the font dynamically:

myLabel.Font = new Font( myLabel.Font.FontFamily, myLabel.Font.Size + 1);

HTH,
Michael Zino
 
Back
Top