Link to home
Start Free TrialLog in
Avatar of wimmeyvaert
wimmeyvaert

asked on

How to bring my form to top ...

Hi Experts,

I have an application that is always minimized. It does some checks, and when the results of those checks are negative, then my app should come in front of all the other applications that are active that moment, in order to be able to inform the user that the checks were bad.

How can this be done ?
I suppose this should be possible (and even simple to do), but I'm not able to do the trick.

Any suggestions ?
Thanx,
The Mayor.

ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Madmarlin
Madmarlin

Not sure off the top pf my head and dont have a delphi program in fromnt of my but I'd check the application object.

It will be something like :

Application.Restore;
Application.BringToFront;
Avatar of wimmeyvaert

ASKER

Hi mnasman, MadMarlin,

Your suggestion works fine, but only if my mainform is minimized. How can I get the same result when my MainForm
is not minimized, but behind another application.

This is my code (only works when form is minimized) :
  if not blnGlobalResultOK then
  begin
    Application.Restore;
    Self.Show;
  end;

Can you please help me any further with this one.
I'll grant the points anyway to mnasman, because he was the first to give me a correct answer to my question.
I hope he wants to help me a bit more to solve my other little question here.

Best regards,
The Mayor.
Hi there,

I just tried MadMarlins suggestion, and this seems to solve my complete problem !!

That doesn't make it easy for me to grant the points, you know.
Because both of you gave me an correct solution (and because I'm in a very good mood today ;-)), I'll give you both 50 points.

So I'm gonna grant the points for this question to mnasman (He was first after all).
In a minute I'll post a new question for MadMarlin (50 points) and if he comments it, I'll grant him the points too.

Anyway, thanx for your quick responses.
The Mayor