<div> <div>CString CMarkupBuilder::TextBuilder(IN CString text,CString MarkTag,CString font </div> <div><span style="white-space:pre;"> </span>,COLORREF textColor ,COLORREF backGround , COLORREF panelColor ,CString vertical ,CString horizontal,CRect& textmargin)</div> <div>{</div></div> <div><span style="white-space:pre;"> </span>wstringstream textheader;</div> <div><span style="white-space:pre;"> </span>text.Replace(L"<",L" <");</div> <div><span style="white-space:pre;"> </span>text.Replace(L">",L" >");</div> <div><span style="white-space:pre;"> </span></div> <div><br></div> <div><span style="white-space:pre;"> </span>if(MarkTag.IsEmpty())</div> <div><span style="white-space:pre;"> </span>MarkTag = text;</div> <div><span style="white-space:pre;"> </span>textheader<<L"<TextBlock Tag='"<<MarkTag.GetBuffer() <<"' " <<"FontWeight='"<<font.GetBuffer()<<"' ";</div> <div><span style="white-space:pre;"> </span>if(backGround != RGB(255,255,255)) textheader<<"Background='"<<colorrefToHexString(backGround).GetBuffer()<<"' ";</div> <div><span style="white-space:pre;"> </span>if(textColor != RGB(255,255,255) ) textheader<<"Foreground='"<<colorrefToHexString(textColor).GetBuffer()<<"' ";</div> <div><span style="white-space:pre;"> </span>textheader<<"VerticalAlignment='"<<vertical.GetBuffer()<<"' "<<"HorizontalAlignment='"<<horizontal.GetBuffer()<<"' ";</div> <div><span style="white-space:pre;"> </span>textheader<<"Margin= '"<<textmargin.left<<","<<textmargin.top<<","<<textmargin.right<<","<<textmargin.bottom<<"'";</div> <div><span style="white-space:pre;"> </span>//textheader<<"FontSize='"<<FontSize<<"' ";</div> <div><span style="white-space:pre;"> </span>textheader<<">";</div> <div><span style="white-space:pre;"> </span>wstring wtextheader(textheader.str());</div> <div><br></div> <div><span style="white-space:pre;"> </span>wstringstream borderheader;</div> <div><span style="white-space:pre;"> </span>borderheader<<L"<Border";;</div> <div><span style="white-space:pre;"> </span>if(panelColor != RGB(255,255,255)) borderheader<<" Background='"<<colorrefToHexString(panelColor).GetBuffer()<<"' ";</div> <div><span style="white-space:pre;"> </span>borderheader<<">";</div> <div><span style="white-space:pre;"> </span>wstring wborder(borderheader.str());</div> <div><span style="white-space:pre;"> </span>TCHAR * tMark = </div> <div><span style="white-space:pre;"> </span>_T("<StackPanel>")</div> <div><span style="white-space:pre;"> </span>_T("%s")<span style="white-space:pre;"> </span>//border</div> <div><span style="white-space:pre;"> </span>_T("%s")<span style="white-space:pre;"> </span>//textheader</div> <div><span style="white-space:pre;"> </span>_T("%s")<span style="white-space:pre;"> </span>//text</div> <div><span style="white-space:pre;"> </span>_T("</TextBlock>")</div> <div><span style="white-space:pre;"> </span>_T("</Border>")</div> <div><span style="white-space:pre;"> </span>_T("</StackPanel>");</div> <div><br></div> <div><span style="white-space:pre;"> </span>CString strMark;</div> <div><span style="white-space:pre;"> </span>strMark.Format(tMark,wborder.c_str(),wtextheader.c_str(),text);</div> <div><span style="white-space:pre;"> </span>return strMark; </div> <div>}</div> <div><br></div> <div>TextBuilder인자중 Font에 Bold라는 속성을 넣으면 잘 적용되는데</div> <div>italic 속성도 같이 주고 싶거든요? 여기서 추가로 넣을 수 있는 방법이 있을까요?</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.