I want to use diffent fonts in CListCtrl but in dialog I see only the last font..
<pre>int dim, nWidth;
DWORD dwStyles;
RECT rList;
CString strCol;
CFont *Font = new CFont;
Font->CreateFont(30,
0,
0,
0,
FW_THIN,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Calibri"));
CListBut *pLst = (CListBut *)GetDlgItem(IDC_LIST1);
pLst->GetWindowRect(&rList);
dim = rList.right - rList.left;
strCol = _T("tttt");
nWidth = (int)(dim * 0.3);
pLst->InsertColumn(0, strCol, LVCFMT_RIGHT, nWidth, -1);
strCol = _T("");
nWidth = (int)(dim * 0.3);
pLst->InsertColumn(1, strCol, LVCFMT_RIGHT, nWidth, -1);
strCol = _T("");
nWidth = (int)(dim * 0.3);
pLst->InsertColumn(2, strCol, LVCFMT_RIGHT, nWidth, -1);
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 100;
lf.lfWeight = 600;
LOGFONT sLogFont;
BOOL bCreated;
CFont font;
CFont *Font1 = new CFont;
Font1->CreateFont(100,
0,
0,
0,
FW_THIN,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Calibri"));
pLst->SetFont(Font1);
int nTagli = 0;
pLst->InsertItem(nTagli, _T("ciao"), -1);
pLst->SetItemText(nTagli, 1, _T("ciao"));
pLst->SetItemText(nTagli, 2, _T("ciao"));
What I have tried:
I tried to use the code that I wrote