출처 : www.devpia.com
void CCommonDlgView::OnFont()
{
CFontDialog dlg(&lf);
color = dlg.GetColor();
if(dlg.DoModal() == IDOK)
{
CString str;
//선택된 글꼴의 정보를 얻는다.
str.Format("Face Name : %s, FontSize :%d",dlg.GetFaceName(), dlg.GetSize()/10);
MessageBox(str,"글꼴정보");
}
}
CFontDialog(LPLOGFONT lplfInitial = NULL, DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,
CDC* pdcPrinter = NULL,CWnd* pParentWnd = NULL);
CFontDialog의 멤버함수
void GetCurrentFont(LPLOGFONT lplf); - 현재 사용하는 폰트의 구조체를 얻는다.
CStrig GetFaceName() const; - 사용하는 푠트의 페이스명(이름)을 얻는다.
CString GetStyleName(0 const; - 사용한는 폰트의 스타일 명
int GetSize() const; - 폰트의 크기를 포인트 단위로 반환
COLORREF GetColor() const; - 사용하는 폰트의 색상을 반환
int GetWeight() const; - 선택된 폰트의 두께를 반환
BOOL IsStrikeOut() const; - 폰트가 ‘strike out' 속성을 가지고 있으면 TRUE값을 반환
BOOL IsUnderline() const; 'underline'
BOOL IsBold() const; 'bold'
BOOL IsItalic() const; 'italic'
CDC* pdcPrinter = NULL,CWnd* pParentWnd = NULL);
CFontDialog의 멤버함수
void GetCurrentFont(LPLOGFONT lplf); - 현재 사용하는 폰트의 구조체를 얻는다.
CStrig GetFaceName() const; - 사용하는 푠트의 페이스명(이름)을 얻는다.
CString GetStyleName(0 const; - 사용한는 폰트의 스타일 명
int GetSize() const; - 폰트의 크기를 포인트 단위로 반환
COLORREF GetColor() const; - 사용하는 폰트의 색상을 반환
int GetWeight() const; - 선택된 폰트의 두께를 반환
BOOL IsStrikeOut() const; - 폰트가 ‘strike out' 속성을 가지고 있으면 TRUE값을 반환
BOOL IsUnderline() const; 'underline'
BOOL IsBold() const; 'bold'
BOOL IsItalic() const; 'italic'
void CCommonDlgView::OnFont()
{
CFontDialog dlg(&lf);
color = dlg.GetColor();
if(dlg.DoModal() == IDOK)
{
CString str;
//선택된 글꼴의 정보를 얻는다.
str.Format("Face Name : %s, FontSize :%d",dlg.GetFaceName(), dlg.GetSize()/10);
MessageBox(str,"글꼴정보");
}
}
"MFC" 카테고리의 다른 글
- 다이얼로그 컨트롤들의 변경 (0)2007/03/27
- 색상선택 CColorDialog (1)2007/03/26
- 폰트 선택 CFontDialog (0)2007/03/26
- 페이지 설정 공통 다이얼로그 박스 CPageSetupDialog (0)2007/03/26
- 프린터/프린트 설정 CPrintDialog (0)2007/03/26

수안이의 컴퓨터 연구실



Leave your greetings.