■ 모든 문단을 특정 폰트로 설정하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
using System.Drawing; using DevExpress.XtraRichEdit; using DevExpress.XtraRichEdit.API.Native; ... RichEditControl richEditControl; ... Document document = richEditControl.Document; for(int i = 0; i < richEditControl.Document.Paragraphs.Count; i++) { DocumentRange documentRange = richEditControl.Document.Paragraphs[i].Range; CharacterProperties characterProperties = document.BeginUpdateCharacters(documentRange); characterProperties.FontName = "바탕체"; characterProperties.FontSize = 12; characterProperties.ForeColor = Color.Black; characterProperties.BackColor = Color.White; characterProperties.Bold = false; characterProperties.Underline = UnderlineType.None; document.EndUpdateCharacters(characterProperties); } |