Click here to Skip to main content
12,999,010 members (48,155 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have Custom Control(Checkers) and User Control(Board) in my project.

But, I can't add Checker to Board.
I drag and drop Checker to Form1 , then add the checker to board in Form_Load, this codes;
Panel a = board1.AddControl(); //AddControl is Event in Board Control

But this code isn't add the checkers;
Checkers b = new Checkers();

How can I add Checker in User Control while application is running?
Posted 8-Dec-12 13:55pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I don't know what you've written in Checkers ??
but what about this..???
Checkers b = new Checkers();
b.Size = ???
b.Position = ??? // X and Y coordinates
b.Visible = ???

Set this kinda properties and give it a try ;) GoOd LucK mate :)
tazugur 9-Dec-12 5:15am
I already wrote them but didn't write it here.
Krunal Rohit 9-Dec-12 5:16am
provide your entire code...
tazugur 9-Dec-12 6:09am
checker[0].Size = new Size(50, 50);
checker[0].Location = new Point(300, 300);
Panel a = board1.GetBoard();

But this code isn't add the Checkers.

How can I add Checker to Board (User Control)?
Krunal Rohit 9-Dec-12 6:12am
I get to see your code... Please post the code..
tazugur 9-Dec-12 6:39am
I sending my project.
Thanks for help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100