je trouve ce tutoriel qui explique comment créer une contrôle d'utilisateur
http://morpheus.developpez.com/usercontrols/
mais quand je suivre le demarche de developement je trouve des erreurs au niveau d'utiliser l'attribut DesignerSerializationVisibility sur votre propriété.
voilà mon code source de mon contrôle insèré
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace authentification
{
    public partial class frm_usercontrol : UserControl
    {
        public frm_usercontrol()
        {
            InitializeComponent();
        }
 
 
        private void UserControl1_Load(object sender, EventArgs e)
        {
 
        }
 
        private void label1_Click(object sender, EventArgs e)
        {
 
        }
 
        private void grp_authentification_Enter(object sender, EventArgs e)
        {
 
        }
 
 
        [Category("Configuration"), Browsable(true), Description("Le titre que vous voulez afficher")]
        public String Title
        {
            get
            {
                return this.grp_authentification.Text;
            }
            set
            {
                this.grp_authentification.Text = value;
            }
        }
 
        [Category("Configuration"), Browsable(true), Description("Le texte à afficher pour le nom d'utilisateur")]
        public String LoginText
        {
            get
            {
                return this.lbl_nomuser.Text;
            }
            set
            {
                this.lbl_nomuser.Text = value;
            }
        }
 
        [Category("Configuration"), Browsable(true), Description("Le texte à afficher pour le mot de passe")]
        public String PasswordText
        {
            get
            {
                return this.lbl_password.Text;
            }
            set
            {
                this.lbl_password.Text = value;
            }
        }
 
 
List<String> list = new List<String>();
 
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public DisplayList
{
	get
	{
		return list;
	}
}
 
    }
}
l'erreur se declanche au niveau de :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
List<String> list = new List<String>();
 
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public DisplayList
{
	get
	{
		return list;
	}
}
quel est l'intèrer de l'attribut DesignerSerializationVisibility et comment resoudre cette erreur?