Unterschiedliche Schriftstärken in der Statusleiste



  • Hallo, ich hab’ gerade erst angefangen WinApi mit VC++ zu proggen. Ich habe von meinen Chef die Aufgabe bekommen in der Stausleiste Schrift, mit unterschiedlichen Schriftstärke, darzustellen. Geht das überhaupt oder muss ich dazu verschiedene Labelkomponenten in die Stausleiste einfügen?



  • Dieser Thread wurde von Moderator/in estartu aus dem Forum MFC (Visual C++) in das Forum WinAPI verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.


  • Mod



  • Jetzt weiß ich zumindest das es geht. Jedoch steht da nicht wie.
    Ich erzeuge mir meine Statusleiste als Objekt der Klasse: CStatusBarCtrl
    und verwende zum manipuliueren: SetParts() und SetText().
    Wie ich den Font der ganzen Statusleiste einstelle hab ich auch schon raus. Kann mir nicht jemand sagen wie ich den Font eines Parts, oder noch besser eines Teilstrings individuell manipulieren kann.

    Mit Java ging alles so einfach. 😞


  • Mod

    alterego schrieb:

    Jetzt weiß ich zumindest das es geht. Jedoch steht da nicht wie.

    Wieso steht da nicht wie. Es steht genau erklärt da:
    Owner-Drawn Status Bars
    You can define individual parts of a status bar to be owner-drawn parts. Using this technique gives you more control than you would otherwise have over the appearance of the window part. For example, you can display a bitmap rather than text or draw text using a different font.

    To define a window part as owner-drawn, send the SB_SETTEXT message to the status bar, specifying the part and the SBT_OWNERDRAW drawing technique. When SBT_OWNERDRAW is specified, the lParam parameter is a 32-bit application-defined value that the application can use when drawing the part. For example, you can specify a font handle, a bitmap handle, an address of a string, and so on.

    When a status bar needs to draw an owner-drawn part, it sends the WM_DRAWITEM message to the parent window. The wParam parameter of the message is the child window identifier of the status bar, and the lParam parameter is the address of a DRAWITEMSTRUCT structure. The parent window uses the information in the structure to draw the part. For an owner-drawn part of a status bar, DRAWITEMSTRUCT contains the following information.


Anmelden zum Antworten