Static mit fetter Schrift - wie?



  • Hallo!

    Da scheinbar gerade die Suche gestorben ist, muss ich nun doch fragen:
    Ich habe ein Static mit der ID IDC_STC_FETT1, wie mache ich von dem Teil die Schrift fett? Eine geänderte Schriftgröße wäre praktisch, ist aber kein "Muss".

    Danke 🙂



  • im Header

    CFont m_font;
    

    in der OnInit Anweisung

    LOGFONT lf;                        // Used to create the CFont.
    
       CDialog::OnInitDialog();           // Call default ::OnInitDialog
    
       memset(&lf, 0, sizeof(LOGFONT));   // Clear out structure.
       lf.lfHeight = 20;                  // Request a 20-pixel-high font
       strcpy(lf.lfFaceName, "Arial");    //    with face name "Arial".
       m_font.CreateFontIndirect(&lf);    // Create the font.
    
       // Use the font to paint a control. This code assumes
       // a control named IDC_STC_FETT1 in the dialog box.
       GetDlgItem(IDC_STC_FETT1)->SetFont(&m_font);
    

    tschau
    Bernhard



  • im Header

    CFont m_font;
    

    in der OnInit Anweisung

    LOGFONT lf;                        // Used to create the CFont.
    
       memset(&lf, 0, sizeof(LOGFONT));   // Clear out structure.
       lf.lfHeight = 20;                  // Request a 20-pixel-high font
       strcpy(lf.lfFaceName, "Arial");    //    with face name "Arial".
       m_font.CreateFontIndirect(&lf);    // Create the font.
    
       // Use the font to paint a control. This code assumes
       // a control named IDC_STC_FETT1 in the dialog box.
       GetDlgItem(IDC_STC_FETT1)->SetFont(&m_font);
    

    tschau
    Bernhard



  • Danke! 🙂


Anmelden zum Antworten