Recent

Author Topic: Components disappear after using link to website  (Read 934 times)

flaza

  • Jr. Member
  • **
  • Posts: 57
Components disappear after using link to website
« 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.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Components disappear after using link to website
« Reply #1 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.
« Last Edit: April 01, 2020, 12:45:46 pm by Bart »

MoCityMM

  • Jr. Member
  • **
  • Posts: 72
Re: Components disappear after using link to website
« Reply #2 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

flaza

  • Jr. Member
  • **
  • Posts: 57
Re: Components disappear after using link to website
« Reply #3 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

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Components disappear after using link to website
« Reply #4 on: April 01, 2020, 04:06:44 pm »
I cannot reproduce that here.

Bart

flaza

  • Jr. Member
  • **
  • Posts: 57
Re: Components disappear after using link to website
« Reply #5 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