Salve a tutti, ho un problema con il SetFont();
dato questo codice:
dove "Controllo" è un bottone.codice:CFont* pFont = GetFont(); LOGFONT lf; pFont = Win->GetFont(); pFont->GetLogFont(&lf); CFontDialog dlg(&lf); if (dlg.DoModal() == IDOK) { LOGFONT lf; memcpy(&lf, dlg.m_cf.lpLogFont, sizeof(LOGFONT)); VERIFY(font.CreateFontIndirect(&lf)); Controllo.SetFont(&font); Controllo.RedrawWindow(); }
Il problema però adesso sorge con un controllo preso dal mouse con la funzione "WindowFromPoint", esempio:
cambia il font, ma non imposta il font scelto, bensì il System a 10 punti.codice:CWnd* Window = WindowFromPoint(point); Window->SetFont(Font);
Spero nel vostro aiuto, grazie.

Rispondi quotando