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
I assume you're using Windows Forms...
A couple of ways.
For OK - set AcceptButton on the form to the OK button. For Cancel - set Cancelbutton on the form to the cancel button.
OR, you can manually set the forms DialogResult to DialogResult.OK or DialogResult.Cancel and then close the form programatically.