Slt,
je cherche à ajouter du texte centré dans un RichEdit, mais jvois pas comment faire,
pour ajouoter en gras, j'utilise :
Mais apparemment CHARFORMAT ne contient pas d'indication sur l'alignement, à moins que jl'ai loupé....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 void DlListing::AppendTextToRecap(CString sTxt, BOOL bBold) { CHARFORMAT Cfm; m_rRecapitulatif.GetSelectionCharFormat(Cfm); Cfm.cbSize = sizeof(CHARFORMAT); Cfm.dwMask = CFM_BOLD; if (bBold == TRUE) Cfm.dwEffects |= CFE_BOLD; else Cfm.dwEffects &= !CFE_BOLD; m_rRecapitulatif.SetSelectionCharFormat(Cfm); long int iTextLength = m_rRecapitulatif.GetTextLength(); m_rRecapitulatif.SetSel(iTextLength,iTextLength); m_rRecapitulatif.ReplaceSel((LPCTSTR)(sTxt + "\r\n")); }
Partager