Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Article Writing
  4. how to change font in menus

how to change font in menus

Scheduled Pinned Locked Moved Article Writing
helptutorialquestion
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    how to change font in menu of window at runtime? can anybody help me?

    J 1 Reply Last reply
    0
    • L Lost User

      how to change font in menu of window at runtime? can anybody help me?

      J Offline
      J Offline
      Jason De Arte
      wrote on last edited by
      #2

      One word: Ownerdraw In a nutshell, you cannot set a magic "font" property (unless maybe VB supports that sort of craziyness) you will need to set the MF_OWNERDRAW flag for each menu item that you want customized & then handle the resulting WM_MEASUREITEM and WM_DRAWITEM messages to actually draw the menu item yourself. Before a menu is displayed windows sends WM_MEASUREITEM to the parent window to get the minimum dimensions for each item with the MF_OWNERDRAW flag set. After querying for the size, windows will send a WM_DRAWITEM message (again, for each ownerdraw menu item) that you can use to draw the menu item with any one of your favorite GDI calls. One little note, you may want to keep a map (or collection of some sort) to keep track of the menu item text, it tends to get forgotten when you mark a menu item as ownerdraw. There are also some samples here on code project that you should check out to help you along. Happy coding :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups