Programlama yapalım ve Öğrenelim. - Delphi Eğitim158
  Ana Sayfa
  .NET Eğitim Notları
  Visual C# .NET Örnek Kodları
  VisualBasic.NET Örnek Kodları
  J# Örnekleri
  ASP.NET Örnek Kodları
  Delphi Eğitim
  => Delphi Eğitim1
  => Delphi Eğitim2
  => Delphi Eğitim3
  => Delphi Eğitim4
  => Delphi Eğitim5
  => Delphi Eğitim6
  => Delphi Eğitim7
  => Delphi Eğitim8
  => Delphi Eğitim9
  => Delphi Eğitim10
  => Delphi Eğitim11
  => Delphi Eğitim13
  => Delphi Eğitim14
  => Delphi Eğitim15
  => Delphi Eğitim16
  => Delphi Eğitim17
  => Delphi Eğitim18
  => Delphi Eğitim19
  => Delphi Eğitim20
  => Delphi Eğitim21
  => Delphi Eğitim22
  => Delphi Eğitim23
  => Delphi Eğitim24
  => Delphi Eğitim25
  => Delphi Eğitim26
  => Delphi Eğitim27
  => Delphi Eğitim28
  => Delphi Eğitim29
  => Delphi Eğitim30
  => Delphi Eğtim31
  => Delphi Eğitim32
  => Delphi Eğitim33
  => Delphi Eğitim34
  => Delphi Eğitim35
  => Delphi Eğitim36
  => Delphi Eğitim37
  => Delphi Eğitim38
  => Delphi Eğitim39
  => Delphi Eğitim40
  => Delphi Eğitim41
  => Delphi Eğitim42
  => Delphi Eğitim43
  => Delphi Eğitim44
  => Delphi Eğitim45
  => Delphi Eğitim46
  => Delphi Eğitim47
  => Delphi Eğitim48
  => Delphi Eğitim49
  => Delphi Eğitim50
  => Delphi Eğitim51
  => Delphi Eğitim52
  => Delphi Eğitim53
  => Delphi Eğitim54
  => Delphi Eğitim55
  => Delphi Eğitim56
  => Delphi Eğitim57
  => Delphi Eğitim58
  => Delphi Eğitim59
  => Delphi Eğitim60
  => Delphi Eğitim61
  => Delphi Eğitim62
  => Delphi Eğitim63
  => Delphi Eğitim64
  => Delphi Eğitim65
  => Delphi Eğitim66
  => Delphi Eğitim67
  => Delphi Eğitim68
  => Delphi Eğitim69
  => Delphi Eğitim70
  => Delphi Eğitim71
  => Delphi Eğitim72
  => Delphi Eğitim73
  => Delphi Eğitim74
  => Delphi Eğitim75
  => Delphi Eğitim76
  => Delphi Eğitim77
  => Delphi Eğitim78
  => Delphi Eğitim79
  => Delphi Eğitim80
  => Delphi Eğitim81
  => Delphi Eğitim82
  => Delphi Eğitim83
  => Delphi Eğitim84
  => Delphi Eğitim85
  => Delphi Eğitim86
  => Delphi Eğitim87
  => Delphi Eğitim88
  => Delphi Eğitim89
  => Delphi Eğitim90
  => Delphi Eğitim91
  => Delphi Eğitim92
  => Delphi Eğitim93
  => Delphi Eğitim94
  => Delphi Eğitim95
  => Delphi Eğitim96
  => Delphi Eğitim97
  => Delphi Eğitim98
  => Delphi Eğitim99
  => Delphi Eğitim100
  => Delphi Eğitim101
  => Delphi Eğitim102
  => Delphi Eğitim103
  => Delphi Eğitim104
  => Delphi Eğitim105
  => Delphi Eğitim106
  => Delphi Eğitim107
  => Delphi Eğitim108
  => Delphi Eğitim109
  => Delphi Eğitim110
  => Delphi Eğitim111
  => Delphi Eğitim112
  => Delphi Eğitim113
  => Delphi Eğitim114
  => Delphi Eğitim115
  => Delphi Eğitim116
  => Delphi Eğitim117
  => Delphi Eğitim118
  => Delphi Eğitim119
  => Delphi Eğitim120
  => Delphi Eğitim121
  => Delphi Eğitim122
  => Delphi Eğitim123
  => Delphi Eğitim124
  => Delphi Eğitim125
  => Delphi Eğitim126
  => Delphi Eğitim127
  => Delphi Eğitim128
  => Delphi Eğitim129
  => Delphi Eğitim130
  => Delphi Eğitim131
  => Delphi Eğitim132
  => Delphi Eğitim133
  => Delphi Eğitim134
  => Delphi Eğitim135
  => Delphi Eğitim136
  => Delphi Eğitim137
  => Delphi Eğitim138
  => Delphi Eğitim139
  => Delphi Eğitim140
  => Delphi Eğitim141
  => Delphi Eğitim142
  => Delphi Eğitim143
  => Delphi Eğitim144
  => Delphi Eğitim145
  => Delphi Eğitim146
  => Delphi eğitim147
  => Delphi Eğitim148
  => Delphi Eğitim149
  => Delphi Eğitim150
  => Delphi Eğitim151
  => Delphi Eğitim152
  => Delphi Eğitim153
  => Delphi Eğitim154
  => Delphi Eğitim155
  => Delphi Eğitim156
  => Delphi Eğitim157
  => Delphi Eğitim158
  => Delphi Eğitim159
  => Delphi Eğitim160
  => Delphi Eğitim161
  => Delphi Eğitim162
  => Delphi Eğitim164
  => Delphi Eğitim165
  => Delphi Eğitim166
  => Delphi Eğitim167
  => Delphi Eğitim168
  => Delphi Eğitim169
  => Delphi Eğitim170
  => Delphi Eğitim171
  => Delphi Eğitim172
  => Delphi Eğitim173
  => Delphi Eğitim174
  => Delphi Eğitim175
  => Delphi Eğitim176
  => Delphi Eğitim177
  => Delphi Eğitim178
  => Delphi Eğitim179
  => Delphi Eğitim180
  => Delphi Eğitim181
  => Delphi Eğitim182
  => Delphi Eğitim183
  => Delphi Eğitim184
  => Delphi Eğitim185
  => Delphi Eğitim186
  => Delphi Eğitim187
  => Delphi Eğitim188
  => Delphi Eğitim189
  => Delphi Eğitim190
  => Delphi Eğitim191
  => Delphi Eğitim192
  => Delphi Eğitim193
  => Delphi Eğitim194
  => Delphi Eğitim195
  => Delphi Eğitim196
  => Delphi Eğitim197
  => Delphi Eğitim198
  => Delphi Eğitim199
  => Delphi Eğitim200
  => Delphi Eğitim201
  => Delphi Eğitim202
  => Delphi Eğitim203
  => Delphi Eğitim204
  => Delphi Eğitim205
  => Delphi Eğitim206
  => Delphi Eğitim207
  => Delphi Eğitim208
  => Delphi Eğitim209
  => Delphi Eğitim210
  => Delphi Eğitim211
  => Delphi Eğitim212
  => Delphi Eğitim213
  => Delphi Eğitim214
  => Delphi Eğitim215
  => Delphi Eğitim216
  => Delphi Eğitim217
  => Delphi Eğitim218
  => Delphi Eğitim219
  => Delphi Eğitim220
  => Delphi Eğitim221
  => Delphi Eğitim222
  => Delphi Eğitim223
  => Delphi Eğitim224
  => Delphi Eğitim225
  => Delphi Eğitim226
  => Delphi Eğitim227
  => Delphi Eğitim228
  => Delphi Eğitim229
  => Delphi Eğitim230
  => Delphi Eğitim231
  => Delphi Eğitim232
  => Delphi Eğitim233
  => Delphi Eğitim234
  => Delphi Eğitim235
  => Delphi Eğitim236
  => Delphi Eğitim237
  => Delphi Eğitim238
  => Delphi Eğitim239
  => Delphi Eğitim240
  => Delphi Eğitim241
  => Delphi Eğitim242
  İletişim

Use help files [* hlp] ?...

{

  First we need to tell the Application object the name

  of the Help file and where to locate it.

 

  Zuerst müssen wir ein Hilfe Datei angeben.

}

 

Application.HelpFile := ExtractFilePath(Application.ExeName) + 'YourHelpFile.hlp';

 

 

 

{

  To Show a help file's content tab:

 

  Um das Inhalts Verzeichnis der Hilfe anzuzeigen:

}

 

Application.HelpCommand(HELP_CONTENTS, 0);

 

 

 

{

  To display a specific topic of your help file:

 

  Ein bestimmtes Thema der Hilfe Datei anzeigen:

}

 

Application.HelpJump('TApplication_HelpJump');

 

Delphi - .....................................

 

neoturk: ...Use help files [* hlp] ?...

{

  First we need to tell the Application object the name

  of the Help file and where to locate it.

 

  Zuerst müssen wir ein Hilfe Datei angeben.

}

 

Application.HelpFile := ExtractFilePath(Application.ExeName) + 'YourHelpFile.hlp';

 

 

 

{

  To Show a help file's content tab:

 

  Um das Inhalts Verzeichnis der Hilfe anzuzeigen:

}

 

Application.HelpCommand(HELP_CONTENTS, 0);

 

 

 

{

  To display a specific topic of your help file:

 

  Ein bestimmtes Thema der Hilfe Datei anzeigen:

}

 

Application.HelpJump('TApplication_HelpJump');

 

Delphi - .....................................

 

neoturk: ...Make a window always minimized ?...

// Form1.Windowstate := wsMinimized;

 

 

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    procedure WMQueryOpen(var Msg: TWMQueryOpen); message WM_QUERYOPEN;

  public

    { Public-Deklarationen }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.DFM}

 

procedure tform1.WMQueryOpen(var Msg: TWMQueryOpen);

begin

  Msg.Result := 0;

end;

 

Delphi - .....................................

 

neoturk: ...Make a window always minimized ?...

// Form1.Windowstate := wsMinimized;

 

 

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    procedure WMQueryOpen(var Msg: TWMQueryOpen); message WM_QUERYOPEN;

  public

    { Public-Deklarationen }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.DFM}

 

procedure tform1.WMQueryOpen(var Msg: TWMQueryOpen);

begin

  Msg.Result := 0;

end;

 

Delphi - .....................................

 

neoturk: ...Minimize controls on the form ?...

procedure TForm1.Button1Click(Sender: TObject);

begin

  CloseWindow(Button1.Handle);

end;

 

Delphi - .....................................

 

neoturk: ...Minimize controls on the form ?...

procedure TForm1.Button1Click(Sender: TObject);

begin

  CloseWindow(Button1.Handle);

end;

 

Delphi - .....................................

 

neoturk: ...Make a 2-line hint ?...

procedure TForm1.FormShow(Sender: TObject);

begin

  Button1.Hint := 'Line 1' + #13#10 + 'Line 2';

end;

 

{ #13#10 will break a line }

{ #13#10 macht einen Zeilenumbruch }

 

Delphi - .....................................

 

neoturk: ...Make a 2-line hint ?...

procedure TForm1.FormShow(Sender: TObject);

begin

  Button1.Hint := 'Line 1' + #13#10 + 'Line 2';

end;

 

{ #13#10 will break a line }

{ #13#10 macht einen Zeilenumbruch }

 

Delphi - .....................................

 

neoturk: ...Make a child form without mdi ?...

uses

  Unit2; { 2. Form }

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  {

  CreateParented creates and initializes a control as the child of a

  specified (non-VCL) container.

 

  Die Methode CreateParented erzeugt und initialisiert ein Steuerelement

  als untergeordnetes Objekt des angegebenen (Nicht-VCL-) Fensters.

  }

  Form2 := TForm2.CreateParented(Form1.Handle);

  // show Form2

  Form2.Show;

  // make Form2 active

  SendMessage(Form2.Handle, WM_NCACTIVATE, Ord(True), 0);

end;

 

procedure TForm1.FormDestroy(Sender: TObject);

begin

  Form2.Close;

end;

 

Delphi - .....................................

 

neoturk: ...Make a child form without mdi ?...

uses

  Unit2; { 2. Form }

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  {

  CreateParented creates and initializes a control as the child of a

  specified (non-VCL) container.

 

  Die Methode CreateParented erzeugt und initialisiert ein Steuerelement

  als untergeordnetes Objekt des angegebenen (Nicht-VCL-) Fensters.

  }

  Form2 := TForm2.CreateParented(Form1.Handle);

  // show Form2

  Form2.Show;

  // make Form2 active

  SendMessage(Form2.Handle, WM_NCACTIVATE, Ord(True), 0);

end;

 

procedure TForm1.FormDestroy(Sender: TObject);

begin

  Form2.Close;

end;

 

Delphi - .....................................

 

neoturk: ...Make a form always on top ?...

with Self do {Form1,...}

  SetWindowPos(Handle, // handle to window

               HWND_TOPMOST, // placement-order handle {*}

               Left,  // horizontal position

               Top,   // vertical position

               Width,

               Height,

               // window-positioning options

               SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);

 

{* Other Values: }

HWND_BOTTOM

Places the window at the bottom of the Z order.

HWND_NOTOPMOST

Places the window above all non-topmost windows

HWND_TOP

Places the window at the top of the Z order.

HWND_TOPMOST

Places the window above all non-topmost windows.

The window maintains its topmost position even when it is deactivated.

 

Delphi - .....................................

 

neoturk: ...Make a form always on top ?...

with Self do {Form1,...}

  SetWindowPos(Handle, // handle to window

               HWND_TOPMOST, // placement-order handle {*}

               Left,  // horizontal position

               Top,   // vertical position

               Width,

               Height,

               // window-positioning options

               SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);

 

{* Other Values: }

HWND_BOTTOM

Places the window at the bottom of the Z order.

HWND_NOTOPMOST

Places the window above all non-topmost windows

HWND_TOP

Places the window at the top of the Z order.

HWND_TOPMOST

Places the window above all non-topmost windows.

The window maintains its topmost position even when it is deactivated.

 

Delphi - .....................................

 

neoturk: ...Hide the main form at startup ?...

{

  Use the ShowMainForm property to control whether the application

  shows its main form on startup.

}

 

{

  Mit der Eigenschaft ShowMainForm können Sie bestimmen,

  ob beim Start der Anwendung das Hauptformular angezeigt wird.

}

 

 

program Project1;

 

uses

  Forms,

  Unit1 in 'Unit1.pas'; {Form1}

 

{$R *.RES}

 

begin

  Application.Initialize;

  Application.CreateForm(TForm1, Form1);

  // Add this Line to your project's file (*.dpr)

  // Diese Zeile hinzufügen in der Projekte Datei (*.dpr) hinzufügen.

  Application.ShowMainForm := False;

  Application.Run;

end.

 

Delphi - .....................................

 

neoturk: ...Hide the main form at startup ?...

{

  Use the ShowMainForm property to control whether the application

  shows its main form on startup.

}

 

{

  Mit der Eigenschaft ShowMainForm können Sie bestimmen,

  ob beim Start der Anwendung das Hauptformular angezeigt wird.

}

 

 

program Project1;

 

uses

  Forms,

  Unit1 in 'Unit1.pas'; {Form1}

 

{$R *.RES}

 

begin

  Application.Initialize;

  Application.CreateForm(TForm1, Form1);

  // Add this Line to your project's file (*.dpr)

  // Diese Zeile hinzufügen in der Projekte Datei (*.dpr) hinzufügen.

  Application.ShowMainForm := False;

  Application.Run;

end.

 

Delphi - .....................................

 

neoturk: ...Make rounded windows ?...

// The CreateEllipticRgn function creates an elliptical region.

 

function CreateEllipticRgn(

    nLeftRect: Integer,  // x-coordinate of the upper-left corner

    nTopRect: Integer,   // y-coordinate of the upper-left corner

    nRightRect: Integer, // x-coordinate of the lower-right

    nBottomRect: Integer // y-coordinate of the lower-right corner

   ): HRGN;

 

// The SetWindowRgn function sets the window region of a window.

 

function SetWindowRgn(

 

    hWnd: HWND, // handle to window whose window region is to be set

    hRgn: HRGN, // handle to region

    bRedraw: Boolean // window redraw flag

   );

 

// Example:

 

procedure TForm1.FormCreate(Sender: TObject);

var

  hRegion: HRGN;

begin

  BorderStyle := bsNone;

  hRegion := CreateEllipticRgn(1, 1, 200, 200);

  SetWindowRgn(Handle, hRegion, True);

end;

 

Delphi - .....................................

 

neoturk: ...Make rounded windows ?...

// The CreateEllipticRgn function creates an elliptical region.

 

function CreateEllipticRgn(

    nLeftRect: Integer,  // x-coordinate of the upper-left corner

    nTopRect: Integer,   // y-coordinate of the upper-left corner

    nRightRect: Integer, // x-coordinate of the lower-right

    nBottomRect: Integer // y-coordinate of the lower-right corner

   ): HRGN;

 

// The SetWindowRgn function sets the window region of a window.

 

function SetWindowRgn(

 

    hWnd: HWND, // handle to window whose window region is to be set

    hRgn: HRGN, // handle to region

    bRedraw: Boolean // window redraw flag

   );

 

// Example:

 

procedure TForm1.FormCreate(Sender: TObject);

var

  hRegion: HRGN;

begin

  BorderStyle := bsNone;

  hRegion := CreateEllipticRgn(1, 1, 200, 200);

  SetWindowRgn(Handle, hRegion, True);

end;

 

Delphi - .....................................

 

neoturk: ...Enable and disable the animation of windows ?...

{

In Win9X or NT4, there's a 'zooming effect' when an application is minimized

to the taskbar or restored from the taskbar.

Delphi applications don't have this zooming effect.

You can switch the effect on or off with the following piece of code:

}

Info: TAnimationInfo;

begin

  ZeroMemory(@Info,SizeOf(Info));

  Info.cbSize := SizeOf(TAnimationInfo);

  BOOL(Info.iMinAnimate) := Value;

  SystemParametersInfo(SPI_SETANIMATION, SizeOf(Info), @Info, 0);

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  SetAnimation(True);

end;

 

Delphi - .....................................

 

neoturk: ...Enable and disable the animation of windows ?...

{

In Win9X or NT4, there's a 'zooming effect' when an application is minimized

to the taskbar or restored from the taskbar.

Delphi applications don't have this zooming effect.

You can switch the effect on or off with the following piece of code:

}

Info: TAnimationInfo;

begin

  ZeroMemory(@Info,SizeOf(Info));

  Info.cbSize := SizeOf(TAnimationInfo);

  BOOL(Info.iMinAnimate) := Value;

  SystemParametersInfo(SPI_SETANIMATION, SizeOf(Info), @Info, 0);

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  SetAnimation(True);

end;

 

Delphi - .....................................

 

neoturk: ...Move windows without a caption bar ?...

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

begin

  ReleaseCapture;

  SendMessage(Form1.Handle, WM_SYSCOMMAND, $F012, 0);

end;

 

Delphi - .....................................

 

neoturk: ...Move windows without a caption bar ?...

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

begin

  ReleaseCapture;

  SendMessage(Form1.Handle, WM_SYSCOMMAND, $F012, 0);

end;

 

Delphi - .....................................

 

neoturk: ...Make a window borderless while dragging ?...

procedure TForm1.PanelTopMouseDown(Sender: TObject;

  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

const

  SC_DRAGMOVE = $F012;

begin

  if (Button = mbLeft) then

  begin

    ReleaseCapture;

    (Self as TControl).Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);

  end;

end;

 

Delphi - .....................................

 

neoturk: ...Make a window borderless while dragging ?...

procedure TForm1.PanelTopMouseDown(Sender: TObject;

  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

const

  SC_DRAGMOVE = $F012;

begin

  if (Button = mbLeft) then

  begin

    ReleaseCapture;

    (Self as TControl).Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);

  end;

end;

 

Delphi - .....................................

 

neoturk: ...Use system icons ?...

{

possible constants:

 

- IDI_APPLICATION

- IDI_ASTERISK

- IDI_EXCLAMATION

- IDI_HAND

- IDI_QUESTION

}

 

//Icons

procedure TForm1.Button1Click(Sender: TObject);

var

  icon: TIcon;

begin

  icon := TIcon.Create;

  try

    icon.Handle := LoadIcon(0, IDI_HAND);

    Canvas.Draw(30, 100, icon);

  finally

    icon.Free

  end;

end;

 

 

 

{

possible constants:

 

- OBM_BTNCORNERS

- OBM_BTSIZE

- OBM_CHECK

- OBM_CHECKBOXES

- OBM_CLOSE

- OBM_COMBO

- OBM_DNARROW

- OBM_DNARROWD

- OBM_DNARROWI

- OBM_LFARROW

- OBM_LFARROWD

- OBM_LFARROWI

- OBM_MNARROW

- OBM_REDUCE

- OBM_RESTORE

- OBM_REDUCED

- OBM_SIZE

- OBM_UPARROW

- OBM_ZOOM

 

}

 

//Bitmaps

procedure TForm1.Button2Click(Sender: TObject);

var

  bitmap: TBitmap;

begin

  bitmap := TBitmap.Create;

  try

    bitmap.Handle := LoadBitmap(0, makeintresource(OBM_RESTORE));

    Canvas.Draw(100, 100, bitmap);

  finally

    bitmap.Free

  end;

end;

 

Delphi - .....................................

 

neoturk: ...Use system icons ?...

{

possible constants:

 

- IDI_APPLICATION

- IDI_ASTERISK

- IDI_EXCLAMATION

- IDI_HAND

- IDI_QUESTION

}

 

//Icons

procedure TForm1.Button1Click(Sender: TObject);

var

  icon: TIcon;

begin

  icon := TIcon.Create;

  try

    icon.Handle := LoadIcon(0, IDI_HAND);

    Canvas.Draw(30, 100, icon);

  finally

    icon.Free

  end;

end;

 

 

 

{

possible constants:

 

- OBM_BTNCORNERS

- OBM_BTSIZE

- OBM_CHECK

- OBM_CHECKBOXES

- OBM_CLOSE

- OBM_COMBO

- OBM_DNARROW

- OBM_DNARROWD

- OBM_DNARROWI

- OBM_LFARROW

- OBM_LFARROWD

- OBM_LFARROWI

- OBM_MNARROW

- OBM_REDUCE

- OBM_RESTORE

- OBM_REDUCED

- OBM_SIZE

- OBM_UPARROW

- OBM_ZOOM

 

}

 

//Bitmaps

procedure TForm1.Button2Click(Sender: TObject);

var

  bitmap: TBitmap;

begin

  bitmap := TBitmap.Create;

  try

    bitmap.Handle := LoadBitmap(0, makeintresource(OBM_RESTORE));

    Canvas.Draw(100, 100, bitmap);

  finally

    bitmap.Free

  end;

end;

 

Delphi - .....................................

 

neoturk: ...Open a form animated ?...

procedure TForm1.Button1Click(Sender: TObject);

 

  procedure Delay(msec: Longint);

  var

    start, stop: Longint;

  begin

    start := GetTickCount;

    repeat

      stop := GetTickCount;

      Application.ProcessMessages;

    until (stop - start) >= msec;

  end;

var

  maxx, maxy: Integer;

begin

  maxx         := form2.Width;

  maxy         := form2.Height;

  form2.Width  := 112;

  form2.Height := 27;

  form2.Left   := (Screen.Width - form2.Width) div 2;

  form2.Top    := (Screen.Height - form2.Height) div 2;

  form2.Show;

 

  repeat

    if form2.Height + (maxy div 5) >= maxy then

      form2.Height := maxy

    else

      form2.Height := form2.Height + (maxy div 5);

 

    if form2.Width + (maxx div 5) >= maxx then

      form2.Width := maxx

    else

      form2.Width := form2.Width + (maxx div 5);

 

    form2.Left := (Screen.Width - form2.Width) div 2;

    form2.Top  := (Screen.Height - form2.Height) div 2;

    delay(30);

 

  until (form2.Width = maxx) and (form2.Height = maxy);

end;

 

Delphi - .....................................

 

neoturk: ...Open a form animated ?...

procedure TForm1.Button1Click(Sender: TObject);

 

  procedure Delay(msec: Longint);

  var

    start, stop: Longint;

  begin

    start := GetTickCount;

    repeat

      stop := GetTickCount;

      Application.ProcessMessages;

    until (stop - start) >= msec;

  end;

var

  maxx, maxy: Integer;

begin

  maxx         := form2.Width;

  maxy         := form2.Height;

  form2.Width  := 112;

  form2.Height := 27;

  form2.Left   := (Screen.Width - form2.Width) div 2;

  form2.Top    := (Screen.Height - form2.Height) div 2;

  form2.Show;

 

  repeat

    if form2.Height + (maxy div 5) >= maxy then

      form2.Height := maxy

    else

      form2.Height := form2.Height + (maxy div 5);

 

    if form2.Width + (maxx div 5) >= maxx then

      form2.Width := maxx

    else

      form2.Width := form2.Width + (maxx div 5);

 

    form2.Left := (Screen.Width - form2.Width) div 2;

    form2.Top  := (Screen.Height - form2.Height) div 2;

    delay(30);

 

  until (form2.Width = maxx) and (form2.Height = maxy);

end;

 

Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol