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. Help?? How to draw chessboard on a form?

Help?? How to draw chessboard on a form?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
13 Posts 5 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.
  • C Cedric Moonen

    I think the best way to do that is to make your own custom control (derived from CWnd). Look at the section in the MFC for miscellaneous controls to get some examples of custom controls.

    L Offline
    L Offline
    LivingThoughts
    wrote on last edited by
    #3

    well thanks for reply. i am trying to create sudoku solver and needs some grid kind of control. Opps! it looks like i have to pull nights again.right!

    C R 2 Replies Last reply
    0
    • L LivingThoughts

      well thanks for reply. i am trying to create sudoku solver and needs some grid kind of control. Opps! it looks like i have to pull nights again.right!

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #4

      :) That's funny because some weeks ago I started to make a Sudoku game and I made already a small control for the grid. There is not a lot of things in it and it is still a little bit uggly but if you are interested, I can send you the code (not now because it is at home). But I stopped the project because I couldn't find a good way to hide some specific cells in order to have a specific solution grid (generating the grid was ok). But don't expect a control with excellent graphics ;)

      L D 2 Replies Last reply
      0
      • C Cedric Moonen

        :) That's funny because some weeks ago I started to make a Sudoku game and I made already a small control for the grid. There is not a lot of things in it and it is still a little bit uggly but if you are interested, I can send you the code (not now because it is at home). But I stopped the project because I couldn't find a good way to hide some specific cells in order to have a specific solution grid (generating the grid was ok). But don't expect a control with excellent graphics ;)

        L Offline
        L Offline
        LivingThoughts
        wrote on last edited by
        #5

        i am happy to know you too are intrested in sudoku. well i'll be glad to have a look at your grid control. pl. send it to this email add(vikramsharma @ gawab.com) thanks again for help

        1 Reply Last reply
        0
        • L LivingThoughts

          Hi guys i want to know how to draw a chessboard on a form. any idea?

          O Offline
          O Offline
          Owner drawn
          wrote on last edited by
          #6

          Why don't you maintain a matrix to draw the Chess board. All blacks are 0's and all whites are 1's.

          Jesus Loves:rose:

          --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

          L 1 Reply Last reply
          0
          • L LivingThoughts

            well thanks for reply. i am trying to create sudoku solver and needs some grid kind of control. Opps! it looks like i have to pull nights again.right!

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #7

            Have you seen that : http://www.codeproject.com/useritems/XSudokuWnd.asp[^] ~RaGE();

            L O 2 Replies Last reply
            0
            • O Owner drawn

              Why don't you maintain a matrix to draw the Chess board. All blacks are 0's and all whites are 1's.

              Jesus Loves:rose:

              --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

              L Offline
              L Offline
              LivingThoughts
              wrote on last edited by
              #8

              maintain a matrix to draw the Chess board i see! nice idea. can you let me know how to drow this way. I guess : -create 2D array. -fill it -create rect, do maths, then create rectangles. but is this ok for sudoku like game where i have to insert numbers in the rectangles. pl. let me know. thanks for idea and reply

              C 1 Reply Last reply
              0
              • L LivingThoughts

                maintain a matrix to draw the Chess board i see! nice idea. can you let me know how to drow this way. I guess : -create 2D array. -fill it -create rect, do maths, then create rectangles. but is this ok for sudoku like game where i have to insert numbers in the rectangles. pl. let me know. thanks for idea and reply

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #9

                Look at the link Rage submitted you. It seems that this control is far more better and complete than the one I made. I suggest that you download the source code and have a look at it.

                L 1 Reply Last reply
                0
                • R Rage

                  Have you seen that : http://www.codeproject.com/useritems/XSudokuWnd.asp[^] ~RaGE();

                  L Offline
                  L Offline
                  LivingThoughts
                  wrote on last edited by
                  #10

                  opps! you are really good at information providing. good man. you are mind blowing dude. you redirected me to heaven. thanks a lot.

                  1 Reply Last reply
                  0
                  • C Cedric Moonen

                    Look at the link Rage submitted you. It seems that this control is far more better and complete than the one I made. I suggest that you download the source code and have a look at it.

                    L Offline
                    L Offline
                    LivingThoughts
                    wrote on last edited by
                    #11

                    ok. well thanks for your reply and advice. you guys are really angels. you helped me a lot.:)

                    1 Reply Last reply
                    0
                    • R Rage

                      Have you seen that : http://www.codeproject.com/useritems/XSudokuWnd.asp[^] ~RaGE();

                      O Offline
                      O Offline
                      Owner drawn
                      wrote on last edited by
                      #12

                      Cheers hans...

                      Jesus Loves:rose:

                      --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

                      1 Reply Last reply
                      0
                      • C Cedric Moonen

                        :) That's funny because some weeks ago I started to make a Sudoku game and I made already a small control for the grid. There is not a lot of things in it and it is still a little bit uggly but if you are interested, I can send you the code (not now because it is at home). But I stopped the project because I couldn't find a good way to hide some specific cells in order to have a specific solution grid (generating the grid was ok). But don't expect a control with excellent graphics ;)

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

                        Cedric Moonen wrote:

                        That's funny because some weeks ago I started to make a Sudoku game...

                        I love that game, and play it every chance I get. I even suggested to our local newspaper to start running it. The editor said I was the first to suggest it, which is a polite way of saying, "Snce the interest is so low, probably not." About a month or so later, I saw the first puzzle! Whether I had anything to do with it or not, I'll never truly know.


                        "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                        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