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. Check box control

Check box control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 4 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.
  • S Offline
    S Offline
    SLiDeR
    wrote on last edited by
    #1

    I want to make my own check box control. Where can i find source code for standard check box (CButton)? Or at least to know how to draw standard check box?

    D S 2 Replies Last reply
    0
    • S SLiDeR

      I want to make my own check box control. Where can i find source code for standard check box (CButton)? Or at least to know how to draw standard check box?

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

      SLiDeR wrote: Where can i find source code for standard check box (CButton)? Have you looked in the \Program Files\Microsoft Visual Studio\VC98\MFC folder? There's a SRC and an INCLUDE folder that have the declaration and definition of the CButton class.


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      S 1 Reply Last reply
      0
      • S SLiDeR

        I want to make my own check box control. Where can i find source code for standard check box (CButton)? Or at least to know how to draw standard check box?

        S Offline
        S Offline
        Steve Obbayi
        wrote on last edited by
        #3

        Ok the way i see it there are two ways you can go about creating a checkbox control. 1. You can use the the visual c++'s resource editor on a dialog box. If you choose to do so you will need see a tutorial on visual c++. this can be found on http://msdn.microsoft.com 2. The other way is to use mfc to do it heres a sample... declare a checkbox control (actually its a special type of Button control) CEdit myCheckBox; go ahead and initialize it myCheckBox.Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); now the dwStyle above must have at least the following flag "BS_AUTOCHECKBOX" heres an example. myCheckBox.Create("Search Any Word", WS_VISIBLE | BS_AUTOCHECKBOX, CRect(365,0,470,30), this, IDC_CHECK1) IDC_CHECK1 is the dialog control ID. Hope this makes sence. void signature(){ cout<<"Sobbayi Interactive"<

        A 1 Reply Last reply
        0
        • S Steve Obbayi

          Ok the way i see it there are two ways you can go about creating a checkbox control. 1. You can use the the visual c++'s resource editor on a dialog box. If you choose to do so you will need see a tutorial on visual c++. this can be found on http://msdn.microsoft.com 2. The other way is to use mfc to do it heres a sample... declare a checkbox control (actually its a special type of Button control) CEdit myCheckBox; go ahead and initialize it myCheckBox.Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); now the dwStyle above must have at least the following flag "BS_AUTOCHECKBOX" heres an example. myCheckBox.Create("Search Any Word", WS_VISIBLE | BS_AUTOCHECKBOX, CRect(365,0,470,30), this, IDC_CHECK1) IDC_CHECK1 is the dialog control ID. Hope this makes sence. void signature(){ cout<<"Sobbayi Interactive"<

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          Oh, i need code to make my own drawn CheckBox, i want to override DrawItem() function.

          1 Reply Last reply
          0
          • D David Crow

            SLiDeR wrote: Where can i find source code for standard check box (CButton)? Have you looked in the \Program Files\Microsoft Visual Studio\VC98\MFC folder? There's a SRC and an INCLUDE folder that have the declaration and definition of the CButton class.


            Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

            S Offline
            S Offline
            SLiDeR
            wrote on last edited by
            #5

            I know about MFC sources. There is CButton source code. But CButton simply uses CreateWindow() function to create check box. But i need source code for DrawItem() function.

            D 1 Reply Last reply
            0
            • S SLiDeR

              I know about MFC sources. There is CButton source code. But CButton simply uses CreateWindow() function to create check box. But i need source code for DrawItem() function.

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

              SLiDeR wrote: I know about MFC sources. Then you also know that you are expected to provide your own CButton::DrawItem() function as the base-class implementation does nothing except fire an assertion. SLiDeR wrote: But i need source code for DrawItem() function. In other words, there is no source code available.


              Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

              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