Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Create a Sizeable Dialog (and also contains SizeGrip)Go to Terrance Hui's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Show how to create a Sizeable Dialog (and also contains SizeGrip)
Product:
Delphi 6.x (or higher)
Category:
Dialogs
Skill Level:
Scoring:
Last Update:
09/17/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet Sizable Dialog Resize Resize Dialog SizeGrip
Times Scored:
7
Visits:
4749
Uploader: Terrance Hui
Company: ICON Business Systems Ltd.
Reference: N/A
 
Question/Problem/Abstract:
How to create a sizeable dialog with sizegrip without using 3rd party component
Answer:



As I know, Delphi would not easy to create a sizable dialog like "File Open Dialog".
I just like to show you how to create a Sizeable Dialog with SizeGrip in Delphi.
I'm not print the sizegrip on the TForm.Canvas because don't want repaint the form everytime when user resizing the dialog.
ps. I'm using D6 and not sure D7 would have this feature already.


unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    PaintBox1: TPaintBox;
    procedure FormCreate(Sender: TObject);
    procedure PaintBox1Paint(Sender: TObject);
  private
  protected
    procedure CreateParams(var Params: TCreateParams); override;
    procedure CreateWnd; override;
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.Style := WS_CAPTION or WS_SIZEBOX or WS_SYSMENU;
  Params.ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
end;

procedure TForm1.CreateWnd;
begin
  inherited CreateWnd;
  SendMessage(Self.Handle, WM_SETICON, 1, 0);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  PaintBox1.Align := alRight;
  PaintBox1.Width := 16;
end;

procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
  With PaintBox1 do
  DrawFrameControl(Canvas.Handle,
                   Rect(Width - 15, Height - 15, Width, Height),
                   DFC_SCROLL,
                   DFCS_SCROLLSIZEGRIP );
end;

end.







Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Shkolnik
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)