Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Collection Of Playing Cards On UserControl
 

Collection Of Playing Cards On UserControl

I have a UserControl and I want it to hold a sequence of PictureBoxes displaying playing cards according to my Property CardCollection Cards, where CardCollection is a List<int>. Valid values are between 0 and 51 to represent each card.

Unfortunately I haven't been able to work out how toprovide the feedback to change/add cards to the UserControl when items are added to CardCollection at runtime or via the collection editor at designtime.

I've been working for hours on this without success, my last attempt was something like this:

Code Snippet

public class CardCollection : List<int>
{

UserControl control;

public override int this[int index]

{
set
{
this[index] = value;

// Code to update control

}
}

public CardCollection(UserControl control)

{

this.control = control;

}

}


Error 1 'UserControls.CtrlSeat.CardCollection.this[int].set': cannot override inherited member 'System.Collections.Generic.List<int>.this[int].set' because it is not marked virtual, abstract, or override D:\My Documents\Visual Studio 2008\Projects\FinalTable\UserControls\CtrlSeat.cs 42 17 UserControls


Any help appreciated, thanks.
Gazumper  Monday, January 28, 2008 1:55 AM
Well I got it working after a long night, nice article about it here on CodeProject although it doesn't mention how to feedback changed properties at designtime when you close the collection editor.
Gazumper  Monday, January 28, 2008 2:16 PM
Well I got it working after a long night, nice article about it here on CodeProject although it doesn't mention how to feedback changed properties at designtime when you close the collection editor.
Gazumper  Monday, January 28, 2008 2:16 PM

You can use google to search for other answers

Custom Search

More Threads

• table integrity
• How to create a Multicolumn ComboBox in VB.Net?
• Option button and Dropdown button
• Text Location in C# Label control .NET forms mysterious padding????
• Controls Disappearing vs 2k5 Professional
• Avoiding the use of a Class
• ContextMenuStrip after closing form
• cant open the project in VS due to user control error at design time
• TextBox classes do not have thie method: set_AutoSize(true)
• Auto Format