C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[16006] RichEdit1->SelAttributes->... = FontDialog1->Font->...;
유지상 [newjisang] 892 읽음    2002-03-06 01:48
void __fastcall TMemoForm::Font1Click(TObject *Sender)
{
  if(FontDialog1->Execute()) {
    RichEdit1->SelAttributes->Color = FontDialog1->Font->Color;
    RichEdit1->SelAttributes->Charset = FontDialog1->Font->Charset;
    RichEdit1->SelAttributes->Size = FontDialog1->Font->Size;
    RichEdit1->SelAttributes->Style = FontDialog1->Font->Style;
    RichEdit1->SelAttributes->Name = FontDialog1->Font->Name;
    RichEdit1->SelAttributes->Pitch = FontDialog1->Font->Pitch;
    RichEdit1->SelAttributes->Height = FontDialog1->Font->Height;
  }
}

위의 메시지헨들러는 richedit control에서 오른쪽버튼누를때 나오는 메뉴를 만들어서 거기서 "font"라는 메뉴아이텀을 클릭할 때 실행되도록 한 코드입니다.
그런데 이게 코드가 길죠.
위에서 하나하나 다 설정해주는 것을 단 한번에 RichEdit1->..... = FontDialog1->Font; 이런 식으로 단 하나 문장으로 대채할 수는 없나요?

+ -

관련 글 리스트
16006 RichEdit1->SelAttributes->... = FontDialog1->Font->...; 유지상 892 2002/03/06
16022     Re:RichEdit1->SelAttributes->... = FontDialog1->Font->...; Falco 975 2002/03/06
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.