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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. custom class like CButton

custom class like CButton

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • K Offline
    K Offline
    kirrik
    wrote on last edited by
    #1

    Hello, I want to create a user defined class which has to work like CButton. That means, from any application by instanciating CButton we can create the CButton window as a child. In the similar manner i require a class which will create a group box and a radio button if we instantiate the button like below. CMyControl myControl(_T("GroupBox Title"), _T("RADIO BUTTON"), CRect, this ptr) In this first parameter is used to put the title for Group Box and the second parameter is for type of the control to be created inside the group box. Third is for size of th group box. Fourth parameter is for ptr to where this control needs to be attached. For the time being we can use the label of radio button be "Radio 1". Can any one help me to write a class like this? Thanks, KirriK

    D 1 Reply Last reply
    0
    • K kirrik

      Hello, I want to create a user defined class which has to work like CButton. That means, from any application by instanciating CButton we can create the CButton window as a child. In the similar manner i require a class which will create a group box and a radio button if we instantiate the button like below. CMyControl myControl(_T("GroupBox Title"), _T("RADIO BUTTON"), CRect, this ptr) In this first parameter is used to put the title for Group Box and the second parameter is for type of the control to be created inside the group box. Third is for size of th group box. Fourth parameter is for ptr to where this control needs to be attached. For the time being we can use the label of radio button be "Radio 1". Can any one help me to write a class like this? Thanks, KirriK

      D Offline
      D Offline
      Don Box
      wrote on last edited by
      #2

      Derive u'r class from CWnd and then u can create button-like, radio-like or checkbox-like controls.

      Come online at:- jubinc@skype

      K 1 Reply Last reply
      0
      • D Don Box

        Derive u'r class from CWnd and then u can create button-like, radio-like or checkbox-like controls.

        Come online at:- jubinc@skype

        K Offline
        K Offline
        kirrik
        wrote on last edited by
        #3

        Can i have any samples? I am sorry i can't come online now. I am in my workplace there it is not possible to come online. -KirriK

        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