?
Solved

FORM TRUE ALIGN AT BOTTOM

Posted on 2007-07-22
12
Medium Priority
?
336 Views
Last Modified: 2010-04-05
Hi All,

I've got a form which I've set to align AlBottom BUT it's not at the bottom of the screen BUT on top of the TaskBar.

Any Ideas on how to get it right at the bottom please?

Thanks

- ST3VO
0
Comment
Question by:ST3VO
  • 6
  • 4
  • 2
12 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 1000 total points
ID: 19543663
 Form1.Top := Screen.Height - Form1.Height;
  Form1.BringToFront;
0
 

Author Comment

by:ST3VO
ID: 19543909
Nope....Still on top of the Taskbar :o(
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 19544042
remove the align = albottom...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:dinilud
ID: 19545391
Form1.Top := Screen.WorkAreaHeight- Form1.Height;
0
 
LVL 10

Expert Comment

by:dinilud
ID: 19545416
procedure AlignBottomRight(Form:TForm);
var R:TRect;
begin
   R:=Screen.WorkAreaRect;
   Form.Top:=R.Bottom-Form.Height;
   Form.Left:=R.Right-Form.Width;
end;

=============

AlignBottomRight(Form1);
0
 

Author Comment

by:ST3VO
ID: 19547161
Hmmm....None of them work :o(

This form that is set to Align on the bottom is not the main form.

The Main form is Maximized and this form I need at the bottom is called from the Main Form to appear.

The space that is left between the AlBottomed form and the bottom of the main form is the size of the taskbar although the main form is over the taskbar!

Hope this helps.

- ST3VO


0
 
LVL 10

Assisted Solution

by:dinilud
dinilud earned 1000 total points
ID: 19548417
ok I UNDRSTOOD.

TheRealLoki's idea is work for me.


remove the align = albottom...( align=alNone)

Form1.Top := Screen.Height - Form1.Height;
Form1.BringToFront;
0
 

Author Comment

by:ST3VO
ID: 19548482
Still not working...

Here is the code:

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
If CheckBox1.Checked then
begin
 Form2.Top := Screen.Height - Form2.Height;
  Form2.BringToFront;
  Form2.show;

---Hope this helps

0
 
LVL 10

Expert Comment

by:dinilud
ID: 19548536
Unit1.dfm
==========
object Form1: TForm1
  Left = 192
  Top = 114
  BorderStyle = bsNone
  Caption = 'Form1'
  ClientHeight = 341
  ClientWidth = 536
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  WindowState = wsMaximized
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 160
    Top = 112
    Width = 161
    Height = 49
    Caption = 'Button1'
    TabOrder = 0
    OnClick = Button1Click
  end
end

Unit1.pas
=======

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  FORM2.Top :=Screen.Height-Form2.Height;
  FORM2.Show;
end;

end.

Unit2.dfm
=========

object Form2: TForm2
  Left = 192
  Top = 257
  Width = 544
  Height = 232
  Caption = 'Form2'
  Color = clActiveCaption
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
end

Unit2.pas
=========
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm2 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

end.

Project1.dpr
============


program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.
0
 

Author Comment

by:ST3VO
ID: 19548608
OK.....got it to work not BUT .... It's not stretched to the whole of the screen width.

Any ideas?

0
 

Author Comment

by:ST3VO
ID: 19548687
OK....

Modified it a bit and it's now working perfectly:

If CheckBox1.Checked then
begin
 Form2.Top := Screen.Height - Form2.Height;
 Form2.Left :=(0);
 Form2.Width := Form1.Width;
  Form2.BringToFront;
  Form2.show;

0
 

Author Comment

by:ST3VO
ID: 19548708
Thanks !!!!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question