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. General Programming
  3. C / C++ / MFC
  4. Menu Font problem [modified]

Menu Font problem [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
3 Posts 2 Posters 0 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.
  • N Offline
    N Offline
    Neeraj Sinha
    wrote on last edited by
    #1

    Hi I am trying the change the default font of the menu. I have used code from http://www.codeproject.com/menu/menuch.asp. In the App file,there are AppendMenu(),DrawItem() overriden functions. Under drawItem(),I have written the code to change the default font of the Menu.I have declared objects like m_FileMenu, m_EditMenu of type App class in the Mainframe header file and through these variables I have called AppendMenu() from within the constructor of Mainframe class. Like m_FileMenu.CreatePopupMenu(); m_FileMenu.AppendMenu(MF_ENABLED,ID_MYFILE_NEW,"&New\tCtrl+N"); m_FileMenu.AppendMenu(MF_ENABLED,ID_FILE_OPEN,"&Open\tCtrl+O"); Similarly, I have called AppendMenu()for m_EditMenu object also. Next,Under CreateMenu()which has been called from OnCreate handler,I have taken the pointer of CMenu through GetMenu(), and all the default items of menu have been removed through RemoveMenu(). Like pMenu->RemoveMenu(0,MF_BYPOSITION); Then,through that CMenu pointer,I have called InsertMenu() through which all the appended items are getting inserted in the menu. Like pMenu->InsertMenu(0,MF_BYPOSITION|MF_POPUP, (UINT)m_FileMenu.m_hMenu,"&File"); pMenu->InsertMenu(1,MF_BYPOSITION|MF_POPUP, (UINT)m_EditMenu.m_hMenu,"&Edit"); Now,the problem is that although the font of all the submenu items are getting changed as per my given font in the drawitem(), but the font of menu items like "File" and "Edit" are not getting changed. If possible Can you please tell me what could be the reason behind it and what should I do to solve it? -- modified at 5:23 Monday 23rd April, 2007

    With Regards Neeraj Sinha Netstudio Pune

    S 1 Reply Last reply
    0
    • N Neeraj Sinha

      Hi I am trying the change the default font of the menu. I have used code from http://www.codeproject.com/menu/menuch.asp. In the App file,there are AppendMenu(),DrawItem() overriden functions. Under drawItem(),I have written the code to change the default font of the Menu.I have declared objects like m_FileMenu, m_EditMenu of type App class in the Mainframe header file and through these variables I have called AppendMenu() from within the constructor of Mainframe class. Like m_FileMenu.CreatePopupMenu(); m_FileMenu.AppendMenu(MF_ENABLED,ID_MYFILE_NEW,"&New\tCtrl+N"); m_FileMenu.AppendMenu(MF_ENABLED,ID_FILE_OPEN,"&Open\tCtrl+O"); Similarly, I have called AppendMenu()for m_EditMenu object also. Next,Under CreateMenu()which has been called from OnCreate handler,I have taken the pointer of CMenu through GetMenu(), and all the default items of menu have been removed through RemoveMenu(). Like pMenu->RemoveMenu(0,MF_BYPOSITION); Then,through that CMenu pointer,I have called InsertMenu() through which all the appended items are getting inserted in the menu. Like pMenu->InsertMenu(0,MF_BYPOSITION|MF_POPUP, (UINT)m_FileMenu.m_hMenu,"&File"); pMenu->InsertMenu(1,MF_BYPOSITION|MF_POPUP, (UINT)m_EditMenu.m_hMenu,"&Edit"); Now,the problem is that although the font of all the submenu items are getting changed as per my given font in the drawitem(), but the font of menu items like "File" and "Edit" are not getting changed. If possible Can you please tell me what could be the reason behind it and what should I do to solve it? -- modified at 5:23 Monday 23rd April, 2007

      With Regards Neeraj Sinha Netstudio Pune

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      Menu will be drawn as per the system font settings. You can try with Owner-Drawn menu Search CP to find more articles on it.

      -Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin

      My blog - Sharing My Thoughts, An Article - Understanding Statepattern

      N 1 Reply Last reply
      0
      • S Sarath C

        Menu will be drawn as per the system font settings. You can try with Owner-Drawn menu Search CP to find more articles on it.

        -Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin

        My blog - Sharing My Thoughts, An Article - Understanding Statepattern

        N Offline
        N Offline
        Neeraj Sinha
        wrote on last edited by
        #3

        Thanks for your reply I have tried with Owner-Drawn menu.The menu items font didn't change.Only the submenu items font got changed.I have used code from the CP itself: http://www.codeproject.com/menu/menuch.asp.

        With Regards Neeraj Sinha Netstudio Pune

        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