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
[7746] Re:[질문] font의 style속성들을 값으로 가져오려면....
코도 [] 2622 읽음    2001-05-25 10:31
    int a = 0;

    if (RichEdit1->Font->Style.Contains(fsBold))
        a += 1;
    if (RichEdit1->Font->Style.Contains(fsItalic))
        a += 10;
    if (RichEdit1->Font->Style.Contains(fsUnderline))
        a += 100;
    if (RichEdit1->Font->Style.Contains(fsStrikeOut))
        a += 1000;

    switch (a)
    {
        case 0:
            RichEdit2->Font->Style = TFontStyles();
            break;
        case 1:
            RichEdit2->Font->Style = TFontStyles()<< fsBold;
            break;
        case 10:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic;
            break;
        case 11:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic;
            break;
        case 100:
            RichEdit2->Font->Style = TFontStyles()<< fsUnderline;
            break;
        case 101:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsUnderline;
            break;
        case 110:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic;
            break;
        case 111:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic << fsUnderline;
            break;
        case 1000:
            RichEdit2->Font->Style = TFontStyles()<< fsStrikeOut;
            break;
        case 1001:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsStrikeOut;
            break;
        case 1010:
            RichEdit2->Font->Style = TFontStyles()<< fsItalic << fsUnderline;
            break;
        case 1011:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic << fsStrikeOut;
            break;
        case 1100:
            RichEdit2->Font->Style = TFontStyles()<< fsUnderline << fsStrikeOut;
            break;
        case 1101:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsUnderline << fsStrikeOut;
            break;
        case 1110:
            RichEdit2->Font->Style = TFontStyles()<< fsItalic << fsUnderline << fsStrikeOut;
            break;
        case 1111:
            RichEdit2->Font->Style = TFontStyles()<< fsBold << fsItalic << fsUnderline << fsStrikeOut;
            break;
    }

이상 허접스런 답변이었습니다.

근데 의문 하나. 이런 경우는 언제 발생 하는 것이죠?
richedit1을 setting 할 때 같이 해주면 되는 거 아닌가요?


301 님이 쓰신 글 :
: 폼1의 richedit의 font의 style속성인 fsItalic이나 fsUnderline등을 값으로 가져와서
: 폼2의 richedit에 적용을 하려고 합니다...
: 폼1의 fsItalic이 트루이면 폼2의 richedit폰트의 스타일의 fsItalic도 트루로...
: 폼1의 fsBold가 트루이면 폼2의 richedit폰트의 스타일의 fsBold도 트루로...
: 이런 식으로 말이죠..
: Style속성은 값으로 못 가져오는 것 같은데 어떻게 해야 되는 지 모르겠네요...
: 아시는 분은 꼭 가르쳐주세요...
: 질문이 너무 허술한가...이해가 가실지 모르겠네요....
:
: 즐거운 하루 되세요~

+ -

관련 글 리스트
7737 [질문] font의 style속성들을 값으로 가져오려면.... 301 1543 2001/05/24
7746     Re:[질문] font의 style속성들을 값으로 가져오려면.... 코도 2622 2001/05/25
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.