2017-02-21 77 views
0

我試着做一個文本編輯器應用程序,但我有關於richtextbox的Font的問題。 phenomonon as bellow: I coppy將文本粘貼到wordpad中,併爲wordpad設置字體爲「Verdana」,如果字體不支持文本字跡自動更改字體爲「Malgun Gothich」,看起來如此美麗。richtextbox的C#混合字體。

Text on wordpad

但是當粘貼這段文字在我的應用程序。我的應用程序有一個Richtextbox控件。 Richtextbox的字體是「Verdana」,但在「Verdana」和「Gulim」之間混合的richtextbox字體看起來很糟糕。

Text on my app

如何解決這個問題,如何顯示我的應用程序的文字看起來像寫字板?

感謝所有,

回答

0

請參考detecting-if-paste-event-occurred-inside-a-rich-text-box

,並使用下面的代碼來更新文本的字體

rtbData.SelectAll(); 
rtbData.SelectionFont = this.Font; // You must change font which you want here. 
+0

在我的應用程序無法正常工作。 –

+0

你使用了哪一個richtextbox事件?你如何創建你的Font對象? – GSP