[user control] Category("Appearance")
Bonjour,
J'ai créé un user control contenant un label. Je veux pouvoir modifier son text, et je veux donc avoir un champ "text" dans la fentre des propriétés lorsque j'utilise mon user control dans un projet. Je suis sur du C# en utilisant le framework compact 3.5. Voilà le code :
Code:
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
| using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace SmartDeviceProject2
{
public partial class buttonImage : UserControl
{
public buttonImage()
{
InitializeComponent();
}
[Category("Appearance")]
public string TitleText
{
get
{
return this.label1.Text;
}
set
{
this.label1.Text = value;
}
}
}
} |
Lors de la compilation VS me met cette erreur:
Citation:
Le type ou le nom d'espace de noms 'Category' est introuvable (une directive using ou une référence d'assembly est-elle manquante*?)
Et ma propriété n'apparaît évidement pas. Qu'est ce que je fais mal :cry: ?
Merci.