C#: How do you send OK or Cancel return messages of dialogs when not using buttons?
How would you return the OK message in the condition of a textbox that will proce
Directly, in the properties of the button itself, there is the DialogResult property that can be set to OK/Cancel/Yes/No/etc... As the others have said, this can also be set programmatically.
In the properties of the form the button is on, set the AcceptButton property to your button. This will also do things like trigger the button when you hit the enter key, and highlight the button.