NumeroClient.info.RemoveAt[Select];
int Num { get { return info.Count; } }
info.Count;
NumeroClient.info[Select] = null; // Select est l’élément a retirer (3)là tu n'enlèves pas un élément tu le remplace par null
Je n'ai pas trouvé l'option RemoveAt(i) comme on peut trouver dans plusieurs exemple
info toto = info[1]; info.Remove(toto);//remove enlève l'instance toto info.RemoveAt(3);//removeAt enlève l'index 3
public class Numero { //public int Num = 0; private List info = new List();// ma variable privée public List Infos// une propriété pour y accéder { get { return info; } set { info = value; } } public int Num//num qui retourne le nombre d'enregistrement devient en lecture seule { get { return info.Count; } } }
public class Info { public string Nom {get; set;} public string Prenom { get; set; } public string EmailP {get; set;} ... }
Erreur 1 'WindowsFormsApplication1.Form1.Info' ne contient pas une définition pour 'RemoveAt' et aucune méthode d'extension 'RemoveAt' acceptant un premier argument de type 'WindowsFormsApplication1.Form1.Info' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?) C:\Users\Gregory\Desktop\Carnet\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 149 18 WindowsFormsApplication1
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; using System.IO; using System.Xml.Serialization; using System.Xml;
public class Info { public string Nom {get; set;} public string Prenom { get; set; } public string EmailP {get; set;} ... }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionList infos = new List();
infos.RemoveAt(3);
List infos = new List()
public class Info { public string Nom {get; set;} public string Prenom { get; set; } public string EmailP {get; set;} ... }
public class Info:iComparable
return this.Nom.CompareTo(other.Nom);//Nom est un string qui est déjà iComparable