Page 1 of 1

Multiple SimpleBrowser2 Forms

Posted: Fri Nov 15, 2024 7:33 am
by KenS
If I have
uvViewingBrowserForm :array of TForm1;
uvCurrentBrowserForm :integer;

where TForm1 is defined in uSimpleBrowser2

and when I create a new form to display an email I iterate over the uvViewingBrowserForm array for a NIL value and use it.

uvViewingBrowserForm.OnClose sets uvViewingBrowserForm[uvCurrentBrowserForm] to nil.

Works ok normally ... but each form has a "Delete" button which deletes the email from that form and opens up the next. At times the form being deleted has not been set to NIL.

I think an answer would be to remove my OnClose and hack the OnCloseQuery in uSimpleBrowser2 to call my OnClose ... but hacking like this causes problems down the track when upgrading

Any ideas?
Thanks
Ken

Re: Multiple SimpleBrowser2 Forms

Posted: Fri Nov 15, 2024 8:02 am
by KenS
In summary I want to have some of my code run when a SimpleBrowser2 instance has closed completely, but not before.

Ken

Re: Multiple SimpleBrowser2 Forms

Posted: Sat Nov 16, 2024 2:11 pm
by salvadordf
See the ToolBoxBrowser demo. It can handle several child forms with browsers.

Re: Multiple SimpleBrowser2 Forms

Posted: Sun Nov 17, 2024 2:38 am
by KenS
Thanks, will have a look

Ken