Good evening everyone, I create a class named chien.cs with this code:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
- namespace formList
- {
- class Chien
- {
- private int nombre;
- public int chatte { get { return nombre; } set { nombre = value; } }
-
- public Chien()
- {
- chatte = 3;
-
- }
- }
- }
and then I create a custom control with this code:
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
-
- namespace formList
- {
- public partial class CustomChien : Control
- {
- public CustomChien()
- {
- InitializeComponent();
- }
-
- protected override void OnPaint(PaintEventArgs pe)
- {
- base.OnPaint(pe);
- }
-
- private List<Chien> listchien = new List<Chien>();
- public List<Chien> ListItem
- {
- get { return listchien; }
- set
- {
- foreach (Chien item in value)
- {
- listchien.Add(item);
-
- }
- }
- }
- }
- }
and then during compiling it shows me this error that I do not understand that to mean.