Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How To Set a Different AcceptButton for each Panel (and UserControl) in a Windows Form

$
0
0

Is there a straightforward way to set a different AcceptButton (and CancelButton) for each Panel (and/or UserControl) on a Windows Form?  I found a Panel.DefaultButton property for a Web app, but nothing so far for a WinForms app.  Barring a simpler method, I'm inclined to handle the Panel Enter and Leave events, setting and resetting ParentForm.AcceptButton in the process.  But that seems awfully inelegant/brute force.

Steve


Viewing all articles
Browse latest Browse all 12583

Trending Articles



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