Jump to content
dormky

How do I close a modal form without ModalResult being set to mrCancel ?

Recommended Posts

1 hour ago, dormky said:

Then please explain ? I delphi, I write to a variable that is then monitored to close the form. In Window, I call a function. Those two things are completely different.

Imagine if you would read documentation. Like that for EndDialog. And imagine if the documentation for EndDialog said this:

 

 

 

EndDialog does not destroy the dialog box immediately. Instead, it sets a flag and allows the dialog box procedure to return control to the system. The system checks the flag before attempting to retrieve the next message from the application queue. If the flag is set, the system ends the message loop, destroys the dialog box, and uses the value in nResult as the return value from the function that created the dialog box.

 

 

 

So yeah, it's exactly the same as the Delphi mechanism. Because that's how modal dialog are implemented in Windows. 

Share this post


Link to post
2 hours ago, dormky said:

There's a reason Delphi is a dead language

Not that again!

 

Just remove the f*ck*** call to Close and be done with it.

  • Haha 1

Share this post


Link to post
16 minutes ago, dummzeuch said:

Not that again!

 

Just remove the f*ck*** call to Close and be done with it.

But, the language is dead because he doesn't have to call Close. If he removes the call to Close and suddenly everything works the way it was designed to, then the language may come back to life. Sounds dangerous. 

Edited by Brandon Staggs

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×