Bonjour,

Je réussi à bien avoir mes données dans mon textbox et je réussi à ce que les données de mon textbox se transfert dans mon bindingsource et puis dans mes objects sans problème lorsque je change de control. Cependant si je veux que le tout aille dans mon bindingsource lorsque je fais "Enter", ca ne marche pas.

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
 
 
//CECI FONCTIONNE
        private void frmActionListNote_Load(object sender, EventArgs e)
        {
            if (this.bsForComment.DataSource != null)
            {
                Binding bindingTxtComment = new Binding("Text", this.bsForComment.DataSource, "NoteDescription");
                this.txtComment.DataBindings.Add(bindingTxtComment);
            }
        }
//CECI NE FONCTIONNE PAS
        private void txtComment_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode== Keys.Enter)
            {
                this.bsForComment.EndEdit();
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Vous avez une idée?