Design time, UserControl parameters
Bonjour
J'ai un UserControl :
Code:
1 2 3 4 5
|
public class MyControl : UserControl
{
public Control MyContainer {get;set;}
} |
Lorsque j'ajoute mon UserControl via le designer dans un formulaire, j'aimerais voir apparaître la propriété MyContainer et lui affecter "This" dans le Form.Designer.cs,
pour obtenir :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
... code généré par VS ...
//
// myControl1
//
this.myControl1.MyContainer = This; // <-- /* ICI */
this.myControl1.Location = new System.Drawing.Point(12, 12);
this.myControl1.Name = "myControl1 ";
this.myControl1.Size = new System.Drawing.Size(817, 1);
this.myControl1.TabIndex = 33;
this.myControl1.Titre = "Titre du formulaire";
... |
DefaultValueAttribute ne fonctionne que pour des constantes, il ne marche pas dans mon cas.
Une idée ?
Merci