Recent

Author Topic: Bringing App to front on Showing a window  (Read 421 times)

zxandris

  • Jr. Member
  • **
  • Posts: 67
Bringing App to front on Showing a window
« on: February 12, 2024, 09:19:48 am »
I'm opening a window in an app I'm working on and I use bring to front and yet it still opens behind any of the other active processes.  Is there a way to bring an app to the forefront programmatically so when you show a window it's automatically in focus?

I don't have any code to offer because I have no idea how to  do this.

I am using BringToFront, on timer, and on FormShow for the first time it does show but that doesn't work.

I'd appreciate any help you can offer, thanks.

CJ

Hartmut

  • Hero Member
  • *****
  • Posts: 736
Re: Bringing App to front on Showing a window
« Reply #1 on: February 12, 2024, 09:33:24 am »
I had the same problem, see https://forum.lazarus.freepascal.org/index.php/topic,65227.0.html

For Windows there was a solution in reply #1, for Linux no solution was found.

cdbc

  • Hero Member
  • *****
  • Posts: 970
    • http://www.cdbc.dk
Re: Bringing App to front on Showing a window
« Reply #2 on: February 12, 2024, 09:41:01 am »
Hi
On my Linux lappy the same problem appears with GTK2...
Solution: Switch to QT  :D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

zxandris

  • Jr. Member
  • **
  • Posts: 67
Re: Bringing App to front on Showing a window
« Reply #3 on: February 12, 2024, 11:48:16 am »
Thanks for the help guys.

jamie

  • Hero Member
  • *****
  • Posts: 6032
Re: Bringing App to front on Showing a window
« Reply #4 on: February 12, 2024, 03:28:53 pm »
Did u try application.bringtofront ?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018