public partial class Form2 : Form
{
public Form2()
{
BackColor = Color.AntiqueWhite;
InitializeComponent();
}
public Form2(string Titre)
: this()
{
Text = Titre;
}
public Form2(string Titre, int positionX)
: this()
{
Text = Titre;
Location.X = positionX;
}
}
On est d'accord que
public Form2(string Titre)
va appeler automatiquement
public Form2()
Mais, dans
public Form2(string Titre, int positionX)
si je voulais appeler automatiquement
public Form2(string Titre)
qui appelerait lui-même automatiquement
public Form2()
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
J
J-L a écrit :
...
Mais, dans public Form2(string Titre, int positionX) si je voulais appeler automatiquement public Form2(string Titre) qui appelerait lui-même automatiquement public Form2()
ça serait possible comment ?
Si je comprends bien ce que tu veux faire :
> public Form2(string Titre, int positionX) > : this(Titre) > { > Location.X = positionX; > }
Jean
J-L a écrit :
...
Mais, dans
public Form2(string Titre, int positionX)
si je voulais appeler automatiquement
public Form2(string Titre)
qui appelerait lui-même automatiquement
public Form2()
ça serait possible comment ?
Si je comprends bien ce que tu veux faire :
> public Form2(string Titre, int positionX)
> : this(Titre)
> {
> Location.X = positionX;
> }
Mais, dans public Form2(string Titre, int positionX) si je voulais appeler automatiquement public Form2(string Titre) qui appelerait lui-même automatiquement public Form2()
ça serait possible comment ?
Si je comprends bien ce que tu veux faire :
> public Form2(string Titre, int positionX) > : this(Titre) > { > Location.X = positionX; > }
Jean
Jean-Luc M.
> > public Form2(string Titre, int positionX) > : this(Titre) > { > Location.X = positionX; > }
Bingo ... merci :-)
-- Jean-Luc M.
>
> public Form2(string Titre, int positionX)
> : this(Titre)
> {
> Location.X = positionX;
> }