Je voudrais avoir un accès direct au texte à l'intérieur d'une zone de texte sur une autre forme, donc j'ajouté une variable publique _txt à une forme et a ajouté un événement comme ceci:Lier une zone de texte à une variable?
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
_txt = richTextBox1.Text;
}
Mais la forme est chargé comme celui-ci :
public FrmTextChild(string text)
{
InitializeComponent();
_txt = text;
richTextBox1.Text = _txt;
Text = "Untitled.txt";
}
Existe-t-il un meilleur moyen de lier directement les deux?