If you try to change the Form.Acceptbutton of a form in the Click event of another button, that is currently the Acceptbutton then you must: #1 //Select next control (simulates Tab press) this.SelectNextControl(this, true, true, true, true); #2 //Set new Acceptbutton this.ParentForm.AcceptButton = buttonLogin; when you press Enter 2times now it works! UPDATEif SelectNextControl doesnt work use this.SelectNextControl(buttonWhichIsActuallySelected, true, true, true, true); then it should work!
Latest Posts
Popular Posts
-
It's easy I thought, just select the Property of the EntityType and set the Default Value in the Properties window to: DateTime.Now ...
-
Had some discussions about Lists and controls, like Listbox and Listview, and sometimes its difficult to distinguish those. System.Win...
-
*Updated* 26. September 2010: Updated with comments from Adam Cogan *Updated* 27. September 2010: Updated the comparison between anonymo...


No comments:
Post a Comment