Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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;
C#
Panel a = board1.AddControl(); //AddControl is Event in Board Control
a.Controls.Add(checkers1);



But this code isn't add the checkers;
C#
Checkers b = new Checkers();
a.Controls.Add(b);


How can I add Checker in User Control while application is running?
Posted

1 solution

I don't know what you've written in Checkers ??
but what about this..???
C#
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 :)
 
Share this answer
 
Comments
Umut Comlekcioglu 9-Dec-12 5:15am    
I already wrote them but didn't write it here.
[no name] 9-Dec-12 5:16am    
provide your entire code...
Umut Comlekcioglu 9-Dec-12 6:09am    
checker[0].Size = new Size(50, 50);
checker[0].Location = new Point(300, 300);
checker[0].BringToFront();
Panel a = board1.GetBoard();
a.Controls.Add(checker[0]);


But this code isn't add the Checkers.


How can I add Checker to Board (User Control)?
[no name] 9-Dec-12 6:12am    
I get to see your code... Please post the code..
Umut Comlekcioglu 9-Dec-12 6:39am    
I sending my project.
http://s2.dosya.tc/server23/AiTTMn/Backgammon.rar.html
Thanks for help.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900