728x90
728x170

Font 설정을 저장하고 불러오는 방법입니다.

프로그램에서 Font 종류나 크기, Style 등을 변경한 경우 이를 저장하고 다시 불러들일때 사용하면됩니다.

using System.ComponentModel;
using System.Drawing;

// 저장될 Font
Font savefont = new Font("Arial", 12, FontStyle.Italic);
// Font TypeConverter 정의
TypeConverter converter = TypeDescriptor.GetConverter(typeof(Font));
// Font 를 String 으로 변경
string fontString = converter.ConvertToString(savefont);
// String 값을 Font 로 변경
Font loadfont = (Font)converter.ConvertFromString(fontString);
728x90
그리드형
Posted by kjun
,