2011-07-26 42 views
0

我想問你如何在C#.Net中的ICSharp TextEditor中更改字體。 我來自Thai.So我想在ICSharp TextEditor中顯示我的語言。 我也更改了屬性框中的字體屬性,但它不起作用。 它只顯示廣場。 我怎樣才能做到這一點..如何更改ICSharp TextEditor中的字體?

感謝您的時間...

+0

您是否嘗試過在代碼中設置TextEditorControlBase.Font屬性? – Qwertie

+0

是的......我明白了..並且我也想清除TextEditor中的所有文本..所以我使用了txtEditor.Text =「」;但它不工作..我可以怎麼做? – CSharpCrazy

回答

0

事實上,似乎設置字體需要在代碼中完成:

textEditorControl1.Font = new Font("Courier New", 8.25f, FontStyle.Regular); 


和清除文字,我用下面的輔助方法:

/// <summary> 
/// Sets the text and refreshes the control. 
/// </summary> 
/// <param name="text">The text.</param> 
public void SetTextAndRefresh(string text) 
{ 
    ResetText(); 
    Text = text; 
    Refresh(); 
} 

對於修改ICSharp文本編輯看到this project on github