Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Form Designer FAQ
Form Designer Home
Delphi Components
See also
Products
Object Inspector
Runtime Fusion
Print Suite
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Object Inspector FAQ
Print Suite FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
Tracking the TFormDesigner
TFormDesigner has two special events fired after changing the selection and changing the selected controls position or size: OnChangeSelection and OnChange. The code below shows how these events can be used.
procedure TForm1.FormDesigner1SelectionChange(Sender: TObject);
begin
  Label1.Caption:=Format(
    '%d control(s) selected',[FormDesigner1.ControlCount]);
end;

procedure TForm1.FormDesigner1Change(Sender: TObject);
var
  i,L,T,R,B: Integer;
begin
  L:=MaxInt;
  T:=MaxInt;
  R:=-MaxInt;
  B:=-MaxInt;
  with FormDesigner1 do
    for i:=0 to Pred(ControlCount) do
      with Controls[i] do
      begin
        if L>Left then L:=Left;
        if T>Top then T:=Top;
        if R<Left+Width then R:=Left+Width;
        if B<Top+Height then B:=Top+Height;
      end;
  Label2.Caption:=Format(
    'The edited controls occupy rectangle (%d,%d,%d,%d)',[L,T,R,B]);
end;

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software