Following is the issue im having....

Im working on a checkers game using c#. ive decided to set each checker within a picturebox that will be displayed inside a panel (gameboard) however the problem comes when I have to move the checkers. I could write code to move the checkers using mouse up, down and move, but problem is to do so I have to drag and drop 24+ picture boxes into the panel to do so. I was thinking of comming up with a way of going PictureBox pb = new PictureBox() each time i needed a checker and then writing an event listener to it dynamically, but so far it doesnt seem to be working....

I really hate to have to drag drop 24 checkers and write mouse move code for each :(

does anyone know if such a thing is possible? what would be the best approach to create the checkers ?

8 Years
Discussion Span
Last Post by Geekitygeek

Try something like this:

private void Form1_Load(object sender, EventArgs e)
            PictureBox pb = new PictureBox();
            pb.Click += new EventHandler(ClickEvent);
            pb.BorderStyle = BorderStyle.Fixed3D;

        private void ClickEvent(object sender, EventArgs e)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.