2012-04-16 5 views
35

은 C#으로 글꼴 크기를 변경하는 가장 쉬운 방법입니다.글꼴 및 글꼴 크기를 가장 쉽게 변경하는 방법

java를 사용하면 필요한 인수를 사용하여 Font 생성자를 호출하여 쉽게 수행 할 수 있습니다.

JLabel lab = new JLabel("Font Bold at 24"); 
lab.setFont(new Font("Serif", Font.BOLD, 24)); 

답변

64

어쩌면 이런 일이 :

yourformName.YourLabel.Font = new Font("Arial", 24,FontStyle.Bold); 

또는 양식 같은 클래스에있는 경우 단순히이 작업을 수행 : 생성자는 diffrent 매개 변수를

YourLabel.Font = new Font("Arial", 24,FontStyle.Bold); 

(그래서 선택 당신의 독약). 이처럼 :

Font(Font, FontStyle) 
Font(FontFamily, Single) 
Font(String, Single) 
Font(FontFamily, Single, FontStyle) 
Font(FontFamily, Single, GraphicsUnit) 
Font(String, Single, FontStyle) 
Font(String, Single, GraphicsUnit) 
Font(FontFamily, Single, FontStyle, GraphicsUnit) 
Font(String, Single, FontStyle, GraphicsUnit) 
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte) 
Font(String, Single, FontStyle, GraphicsUnit, Byte) 
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte, Boolean) 
Font(String, Single, FontStyle, GraphicsUnit, Byte, Boolean) 

참조 here

5

이 그것을 (굵게뿐만 아니라)해야한다;

label1.Font = new Font("Serif", 24,FontStyle.Bold); 
7

사용이 하나를

label1.Font = new System.Drawing.Font(label1.Font.Name, 24F); 
0

varible을 만든 다음 텍스트에 할당 할 수도 있습니다. 두 개 이상의 텍스트를 지정할 수 있기 때문에 멋지다. 다음 쓰기 "-

이 varible는 텍스트 yet.To에 할당되지 않은

public partial class Sayfa1 : Form 

    Font Normal = new Font("Segoe UI", 9, FontStyle.Bold); 

    public Sayfa1() 

그것 (> (이름) proporties를 봐) 텍스트의 이름을 쓰는가 않는 변수를 지정하려면 폰트 변수의 이름을 호출하십시오.

lupusToolStripMenuItem.Font = Normal; 

이제 일반 글꼴이 할당 된 텍스트가 있습니다. 내가 도움이되기를 바랍니다.

관련 문제