Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Not doing code correctly

$
0
0

I have an edit usercontrol that becomes visible every time I press F2 on a row in a datagridview. This usercontrol pops up so that I can edit all the rows in the datagridview. I wrote that every time the usercontrol fills with data (which is every time I press F2) I do 

This.Parentform.acceptbutton = btnOK

this.parentform.cancelbutton = btncancel 

this.txtName.Select();

this only works the first time the usercontrol becomes visible after that it doesn't do this code even though it goes through it. So the btnOK looks like it's the accept button but pressing enter doesn't do anything to it. Also, the txtName is not selected. Any clue why this would be happening?


Debra has a question


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>