Jump to content

Positon Form


artem_niko

Recommended Posts

Hello!

I want show my Form1 (FreeForm) in anouther position, for example, in left top corner.

Code:

procedure TUniForm1.UniFormCreate(Sender: TObject);
begin
  Left:=Screen.WorkAreaWidth - Width;
  Top:=Screen.WorkAreaHeight - Height;
end;

not working.

Please, help me with this question. 

Link to comment
Share on other sites

@Sherzod

I want that my Form1 will be above taskbar, like when open Start in Windows 8/10.

When I pressing button - Form1 must be above windows Taskbar.

Now Form1 creating behind Taskbar:

image.thumb.png.51cfdbfd0a9ce5359af2d86a0dba6bce.png

This is my code in Form1:

procedure TUniForm1.UniFormShow(Sender: TObject);
begin
  Left:=0;
  Top:=Screen.WorkAreaHeight - Height;
end;

 

Please, help.

Link to comment
Share on other sites

4 hours ago, Артем said:

I want that my Form1 will be above taskbar, like when open Start in Windows 8/10.

When I pressing button - Form1 must be above windows Taskbar.

Now Form1 creating behind Taskbar

Can you please explain in more detail? 

Better attach a test case.

Link to comment
Share on other sites

6 minutes ago, Артем said:

Can't set params coordinate for Form1, that Form1 will be showing in left bottom corner, above Windows Taskbar...

 Form1 showing under taskbar.

I do not really imagine...

But maybe you need to set UniMainModule.ConstrainForms to True:

UniMainModule.ConstrainForms = True

 

Link to comment
Share on other sites

13 minutes ago, Sherzod said:

Your forms will not go beyond the main form

Cool! Great, working! :) Thank's.

One last question: Form1 showing good, but I need add to Form1.Top position value of custom heiht, for example, 45.

Look: 

procedure TUniForm1.UniFormShow(Sender: TObject);
begin
  Left:=0;
  Top:=Screen.WorkAreaHeight - (Height + 45);
end;

But Form1 showing ignore my value=45.

Now:

image.png.6184801ec628423e288ad5dc9364dc2a.png

I need:

image.png.8ea79fffd399ace038bec078c7ae9417.png

45 - this is MainForm.UniContainerPane1.Height.

Help.

Link to comment
Share on other sites

4 minutes ago, Sherzod said:

Try a little big value. 

Was write:

procedure TUniForm1.UniFormShow(Sender: TObject);
begin
  Left:=0;
  Top:=Screen.WorkAreaHeight - Height - 120;
end;

and now normal...

But why 120 - good, 45 - no.....I understand.... :(

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...