Form AcceptButton

0
0

Hi,

i’m migrating from VWG to Wisej and now I’m facing problem with AcceptButton. When I set AcceptButton to a window and do not set click event for that button. The window does not close when I press Enter. In VWG it works. Is it a bug or not? Any work around for it?

Thanks you for your help,

Page

  • You must to post comments
0
0

AcceptButton causes the buttons to be clicked when pressing Enter. CancelButton causes the button to be clicked when pressing Esc.

In WinForms they also automatically close a form only when created using ShowDialog() while they do not close a form when created using Show(). We decided early on not to duplicate many little inconsistencies like this one. The action to take when the AcceptButton (or CancelButton) are clicked with Wisej depends on the app. All you need to do is add a Click event and call Close() if that is the behavior you need in the app.

  • Page Page
    Hi, I don’t think it as an inconsistency in winform. When you call ShowDialog(), you need to close it before using other form, so AcceptButton works like a shortcut in this case. My project has more than hundred forms, go through all the forms and add Click event is not good for me. Page
  • Luca (ITG)
    You can override the AcceptButton property and attach to the Click event and call Close() in a base class to get the behavior you need.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.