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. Button Color In MFC

Button Color In MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
22 Posts 5 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.
  • 0 002comp

    Hello JohnCz I tried to use CMFCButton but there is no class in VS2008 prof. Do i need to link up something? Thanks Again. Regards Yogesh

    D Offline
    D Offline
    David Crow
    wrote on last edited by
    #21

    yogeshs wrote:

    I tried to use CMFCButton...

    How? When you added a button to the dialog template and went to assign a variable to it, the Add Member Variable Wizard defaulted to CButton. All you need to do is change that to CMFCButton. The appropriate header file (i.e., afxbutton.h) would have been added automatically, if it was not already included.

    "One man's wage rise is another man's price increase." - Harold Wilson

    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

    "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

    1 Reply Last reply
    0
    • 0 002comp

      Hello JohnCz I tried to use CMFCButton but there is no class in VS2008 prof. Do i need to link up something? Thanks Again. Regards Yogesh

      J Offline
      J Offline
      JohnCz
      wrote on last edited by
      #22

      Hi yogeshs, You have to learn how to be patient and read all answers and documentation without skipping some parts. I have already mentioned twice: If you are using VS 2008 with feature pack or with SP1 use CMFCButton class. You need Visual Studio SP1 installed. Web installer[^] ISO image[^] Than you can subclass button using CMFCCustButton. Subclassing is easy if you use wizard: Right click on the button in the resource editor and choose Add Variable. The only option you have is CButton, so select it. After wizard closes, open dialog’s header file and change CButton to CMFCMenuButton.

      JohnCz

      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