Lazarus

Programming => LCL => Topic started by: flaza on April 01, 2020, 11:23:11 am

Title: Components disappear after using link to website
Post by: flaza on April 01, 2020, 11:23:11 am
Hi,

I'm using lazarus 2.0.4 on Windows10. I have a program for an internal tenniscompetition that can create webpages. In that program there is the possibility to open the index page. But after closing the browser or changing back to the program 2 other fields in the form are invisible. This happens only after using the link to open the browser, not when I change to another program and back. I added a small test program.
Can someone explain what is happeing and how I can prevent it or repair it.

Thx.
Title: Re: Components disappear after using link to website
Post by: Bart on April 01, 2020, 12:40:28 pm
I have no idea why this happens to you.
But out of curiosity: why don't you use OpenURL() instead of trying to find the default browser yourself?

Your detection code doesn't find my browser (FF on Win10-64).
OpenURL works just fine, and I see no visual abnormalities.

Bart

PS: OpenUrl is in the LCLIntf unit.
Title: Re: Components disappear after using link to website
Post by: MoCityMM on April 01, 2020, 12:53:50 pm
What is the exact registry key you are looking for? It does not exist on my machine.

I would try to see if the registry key(s) exist prior to reading them and see if that resolves the issue.

I've had components turn invisible before and it was usually due to coding logic that I implemented.

-Mo
Title: Re: Components disappear after using link to website
Post by: flaza on April 01, 2020, 03:14:50 pm
Thx Bart and Mo,

Now I use OpenUrl I get always the users default browser, so I removed all the unnecessary code. The problem however is not solved. If I open and close the browser, it all goes well. But when I open the browser and than change back to the program, my fields are not visible.
Any other thougths?

Thx.
Frans
Title: Re: Components disappear after using link to website
Post by: Bart on April 01, 2020, 04:06:44 pm
I cannot reproduce that here.

Bart
Title: Re: Components disappear after using link to website
Post by: flaza on April 02, 2020, 03:38:05 pm
Hi,
I solved my problem (so it seems). I created a procedure wich repaints the two components involved. That procedure is assigned to Application.OnActivate only if the specific form is active. It works almost perfect, for now enough to close this item.

Ths all for your help.
Frans
TinyPortal © 2005-2018