ilker.Weblog()

2008-12-23

C# Windows Application - change font size - code behind

Windows uygulamasında label.Font.Size özelliği read-only'dir ve atama yapılamaz.

Kod içinden font boyutunu değiştirmek için şu metodu kullanabiliriz:

public Font changeFontSize( Font font, float fontSize )
{
if (font != null)
{
float currentSize = font.Size;
if (currentSize != fontSize)
{
font = new Font(font.Name, fontSize,
font.Style, font.Unit,
font.GdiCharSet, font.GdiVerticalFont);
}
}
return font;
}

Etiketler:

0 Yorum:

Yorum Gönder

Kaydol: Kayıt Yorumları [Atom]



<< Ana Sayfa