Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Multiple SimpleBrowser2 Forms

Post Reply
KenS
Posts: 28
Joined: Sat Aug 10, 2024 12:44 am
Location: Australia

Multiple SimpleBrowser2 Forms

Post 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
KenS
Posts: 28
Joined: Sat Aug 10, 2024 12:44 am
Location: Australia

Re: Multiple SimpleBrowser2 Forms

Post by KenS »

In summary I want to have some of my code run when a SimpleBrowser2 instance has closed completely, but not before.

Ken
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Multiple SimpleBrowser2 Forms

Post by salvadordf »

See the ToolBoxBrowser demo. It can handle several child forms with browsers.
KenS
Posts: 28
Joined: Sat Aug 10, 2024 12:44 am
Location: Australia

Re: Multiple SimpleBrowser2 Forms

Post by KenS »

Thanks, will have a look

Ken
Post Reply