Jump to content
dormky

BringToFront doesn't work

Recommended Posts

Put both components TImage and a TDrawGrid on separate panels.

Edited by Die Holländer

Share this post


Link to post
Just now, Die Holländer said:

Put both components TImage and a TDrawGrid on separate panels.

I want to make a loading overlay. I can't exactly go through the whole program doing this :')

Share this post


Link to post

Try it this way

 

procedure TFormMain.FormCreate(Sender: TObject);
begin
  Image1.Parent := DrawGrid1;
  Image1.Left := 0;
end;

 

Share this post


Link to post
1 hour ago, David Heffernan said:

Try calling BringToFrontNoCap()

There is no such method in VCL.

Share this post


Link to post
8 hours ago, dormky said:

I have a TImage and a TDrawGrid. Calling BringToFront() on TImage does not put it above the drawgrid

TDrawGrid is derived from TWinControl, whereas TImage is derived from TGraphicControl.  Both controls in your DFM have the same Parent (the Form).  A graphical control is rendered directly onto the canvas of its Parent, and thus can never appear on top of a child windowed control of the same Parent.

8 hours ago, dormky said:

what am I supposed to use ?

As  suggested earlier, you will have to make the TImage be a child of the TDrawGrid, or put the TImage on a separate Form (or Frame) that is on top of the TDrawGrid.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×