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. Simple Button Styles Question

Simple Button Styles Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionwpfhelptutorial
2 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.
  • D Offline
    D Offline
    Dave Kerr
    wrote on last edited by
    #1

    Hi All, I'm tearing my hear out over this one. I am subclassing controls dynamically at runtime. I run through each child control of a window, and check it's class. If the class is "BUTTON" I want to subclass it to one of four controls: CThemedButton : public CButton CThemedRadioButton : public CButton CThemedGroupBox : public CButton CThemedCheckBox : public CButton However, I cannot for the life of me get the correct combination of window styles to make this work in every case. My code is as below: bool bGroupBox = (dwControlStyle&BS_GROUPBOX); bool bRadioButton = (dwControlStyle&BS_RADIOBUTTON); bool bAutoRadioButton = (dwControlStyle&BS_AUTORADIOBUTTON); bool bCheckBox = (dwControlStyle&BS_CHECKBOX); bool bAutoCheckBox = (dwControlStyle&BS_AUTOCHECKBOX); bool bPushLike = (dwControlStyle&BS_PUSHLIKE); But I'm getting bizarre results. It seems that BS_AUTORADIOBUTTON for example is a combination of other flags, as is BS_GROUPBOX. The end result is I get some buttons that are subclassed, unless they're the default buttons, group boxes aren't picked up, check boxes are missed. The button styles aren't proper flags it seems, so I'm getting cases where bRadioButton, bAutoRadioButton and bGroupBox are all true! Please can anyone help me here? This should be simple but it's been causing me no end of problems. Thanks in advance, Dave Kerr

    J 1 Reply Last reply
    0
    • D Dave Kerr

      Hi All, I'm tearing my hear out over this one. I am subclassing controls dynamically at runtime. I run through each child control of a window, and check it's class. If the class is "BUTTON" I want to subclass it to one of four controls: CThemedButton : public CButton CThemedRadioButton : public CButton CThemedGroupBox : public CButton CThemedCheckBox : public CButton However, I cannot for the life of me get the correct combination of window styles to make this work in every case. My code is as below: bool bGroupBox = (dwControlStyle&BS_GROUPBOX); bool bRadioButton = (dwControlStyle&BS_RADIOBUTTON); bool bAutoRadioButton = (dwControlStyle&BS_AUTORADIOBUTTON); bool bCheckBox = (dwControlStyle&BS_CHECKBOX); bool bAutoCheckBox = (dwControlStyle&BS_AUTOCHECKBOX); bool bPushLike = (dwControlStyle&BS_PUSHLIKE); But I'm getting bizarre results. It seems that BS_AUTORADIOBUTTON for example is a combination of other flags, as is BS_GROUPBOX. The end result is I get some buttons that are subclassed, unless they're the default buttons, group boxes aren't picked up, check boxes are missed. The button styles aren't proper flags it seems, so I'm getting cases where bRadioButton, bAutoRadioButton and bGroupBox are all true! Please can anyone help me here? This should be simple but it's been causing me no end of problems. Thanks in advance, Dave Kerr

      J Offline
      J Offline
      josda1000
      wrote on last edited by
      #2

      Aren't Group Boxes actually Statics, not Buttons? That should help you a little, but I don't have answers for the others.

      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