|
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속성은 값으로 못 가져오는 것 같은데 어떻게 해야 되는 지 모르겠네요...
: 아시는 분은 꼭 가르쳐주세요...
: 질문이 너무 허술한가...이해가 가실지 모르겠네요....
:
: 즐거운 하루 되세요~
|