abdelwaheb ammar

abdelwaheb ammar

  • NA
  • 210
  • 24.1k

create a List of list

Sep 14 2016 2:09 PM
Good evening everyone, I create a class named chien.cs with this code:
 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5.   
  6. namespace formList  
  7. {  
  8.     class Chien  
  9.     {  
  10.         private int nombre;  
  11.         public int chatte { get { return nombre; } set { nombre = value; } }  
  12.   
  13.         public Chien()  
  14.         {  
  15.             chatte = 3;  
  16.   
  17.         }  
  18.     }  
  19. }  
 and then I create a custom control with this code:
 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.ComponentModel;  
  4. using System.Data;  
  5. using System.Drawing;  
  6. using System.Linq;  
  7. using System.Text;  
  8. using System.Windows.Forms;  
  9.   
  10. namespace formList  
  11. {  
  12.     public partial class CustomChien : Control  
  13.     {  
  14.         public CustomChien()  
  15.         {  
  16.             InitializeComponent();  
  17.         }  
  18.   
  19.         protected override void OnPaint(PaintEventArgs pe)  
  20.         {  
  21.             base.OnPaint(pe);  
  22.         }  
  23.   
  24.         private List<Chien> listchien = new List<Chien>();  
  25.         public List<Chien> ListItem  
  26.         {  
  27.             get { return listchien; }  
  28.             set  
  29.             {  
  30.                 foreach (Chien item in value)  
  31.                 {  
  32.                     listchien.Add(item);  
  33.   
  34.                 }  
  35.             }  
  36.         }  
  37.     }  
  38. }  
 and then during compiling it shows me this error that I do not understand that to mean.
 
 

Answers (1)