Ax technical regarding form

i have to execute a logic while closing a form by clicking “X” button alone,where i have to write the code ,close() method?

i cant use closedok,it will execute while cliking ok button,so i cant use that method

Hi,

Can you brief ur requirement elaborately… What should happen when you click the X button and whether the form should close after clicking the X button ??

If you use the cross instead of OK or Cancel commands, neither closeOk() nor closeCancel() get called and both closedOk() and closedCancel() return false.

Therefore you can check in close() if (!closedOk() && !closedCancel()).

thnk u all…i got the solution

how to use closeok method in a class,onli closedok ,return type boolean onli working.how to solve tis issue,i want execute a logic onli ok button is clicked ,that ok button is a command button

You say that that only closeOk() work, not closeOk(), which doesn’t make sense. You probably meant that only closedOk() works, which is want you should use and what’s in my code snippet.

If you want a logic specific to the OK command, place it to closeOk(), of course.

Please proofread your questions before sending. Thank you.

Sorry for the inconvenience,I want to use closeok method in a class ,but its not working,because ,its return type is void

i used it as

if(objectname.closeok())

{

logic

}

but its not working

Of course you can’t do that. That’s obvious.

You can place your code to closeOk() - it’ll be executed when a form is being closed by OK command and it’ll set the flag that can be later accessed by closedOk().

The code I gave you was if (!closedOk() && !closedCancel()).

closed ok is nt triggering in the form,…im using form run in a class to acces the form ,then i wrote

if(!formrun.closed())

{

logic

}

else

{

info msg

}

}

ist nt gng to else condition

Your “else” block means “if the form hasn’t been closed”. You obviously wanted to use closedOk(), not close().

You would use your time (not mentioning my time) better if you read your code instead of writing such questions.