Hi, again, uh...believe me, I would like I haven't asked all those newbie questions so far. I always try to find answer somehow else and not to bother you guys here.
But, I'm still pretty new to Delphi and even OOP, so please forgive me if I ask too much (or I ask stupid questions).
Problem:
I have two forms, second one modal, not autocreated (except first-main)(but it seems to me that even they are both autocreated the problem stands still); modal form has two speedbuttons; on modal form OnActivate event it starts to do something with picture on it (checking pixel's color etc.)(loops inside); on speedbutton1 click-doing something else(also with loops); both operations are very cpu intensive (cpu use about 100%);speedbutton2 click sets ModalResult:=mrAbort; and modal form won't close.
I even put Application.ProcessMessages; but nothing.
My question:
how can I close my second (modal) form clicking speedbutton2,as it should be, and is, if I do not do anything on the form.
Please, without using threads, I like them, but I need explanation why this above doesn't work assuming this:
(from Delphi help file)
To close a modal form, set its ModalResult property to a nonzero value.
Note: If the form contains buttons with a ModalResult property set to a value other than mrNone, the form automatically closes when the user clicks one of those buttons and returns the ModalResult value as the return value of ShowModal.
And if there is explanation, maybe there is a solution, too?
Any help or try will be highly appreciated...
But, I'm still pretty new to Delphi and even OOP, so please forgive me if I ask too much (or I ask stupid questions).
Problem:
I have two forms, second one modal, not autocreated (except first-main)(but it seems to me that even they are both autocreated the problem stands still); modal form has two speedbuttons; on modal form OnActivate event it starts to do something with picture on it (checking pixel's color etc.)(loops inside); on speedbutton1 click-doing something else(also with loops); both operations are very cpu intensive (cpu use about 100%);speedbutton2 click sets ModalResult:=mrAbort; and modal form won't close.
I even put Application.ProcessMessages; but nothing.
My question:
how can I close my second (modal) form clicking speedbutton2,as it should be, and is, if I do not do anything on the form.
Please, without using threads, I like them, but I need explanation why this above doesn't work assuming this:
(from Delphi help file)
To close a modal form, set its ModalResult property to a nonzero value.
Note: If the form contains buttons with a ModalResult property set to a value other than mrNone, the form automatically closes when the user clicks one of those buttons and returns the ModalResult value as the return value of ShowModal.
And if there is explanation, maybe there is a solution, too?
Any help or try will be highly appreciated...