home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 August
/
VPR9708A.ISO
/
D3TRIAL
/
INSTALL
/
DATA.Z
/
DROPFONT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-04-24
|
1KB
|
42 lines
{ Simple drag/drop demonstration program. }
unit Dropfont;
interface
uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Memo1: TMemo;
procedure Memo1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure Memo1DragDrop(Sender, Source: TObject; X, Y: Integer);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{ Only accept if the source of the drag is a label. Note that }
{ all the labels' DragMode properties are set to dmAutomatic. }
procedure TForm1.Memo1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := Source is TLabel;
end;
{ Assign the label's font to the memo field. }
procedure TForm1.Memo1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
Memo1.Font := (Source as TLabel).Font;
end;
end.