You need to set the form's ModalResult to a nonzero value. For example:
Code:
ModalResult = 1;
James P. Cottingham
I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
Wings,
[tab]I wondered about that but according to the help files you have to set ModalResult. I wonder what would happen if you do Close()????? I did notice that ModalResult sends it results back to the opening form, maybe close would work but not send anything back to the original form.
James P. Cottingham
I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
Both methods should work fine, but the best way would be to set the ModalResult property of buttons on the form at design-time, that way you don't need to write any event handlers and the form automatically closes when a button is pressed.
Also with MOdalResult you can use the return value of ShowModal to check if the user pressed OK, Cancel etc.
As near as I can tell, quasin00b is right. Both work but if you want to have a return value you have to use ModalResult.
James P. Cottingham
I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.