1. DRAG&DROP
Windows , Drag&Drop ( ). Windows . Delphi Drag&Drop, . , .
property DgagMode: TDragMode;
TGragMode = (dmManual, dmAutomatic);
, , Drag&Drop: dmManual (); dmAutomatic ( ). .
Property DradCursor: TCursor;
, 2 . , crDrag, crNoDrag. , DgagMode = dmAutomatic.
OnDragOver(Sender, Soursce: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean) .
Sender , ; Soursce - ; X, Y ; State (dsDragEnter ; dsDragLeave ; dsDragMove ). Accept , .
OnDragDropEvent(Sender, Soursce: TObject; X, Y: Integer) , . OnDragOver.
, ( , )
OnEndDrag(Sender, Target: TObject; X, Y: Integer);
Sender ; Target NIL, ; X, Y .
1.
, 2 ListBox, Edit, Panel . :
Edit 1 ;
;
1 .
2.
, StringGrid Edit. Edit .
ActiveX
- . , . - , . ( ) , .
|
|
Microsoft -. Microsoft , ActiveX.
Microsoft Excel , Delphi Excel, . , , ActiveX-.
, , , .
, , . OnCreate. Session.GetDatabaseNames. Session.GetTableNames. .
, Dbase, FoxPro Paradox, . .
.
ActiveX - - , Microsoft Excel Microsoft Word. Delphi SetActiveOleObject CreateObject - . ComObj, Uses. , , Excel.Application Microsoft Excel Word.Document Microsoft Word.
, - SetActiveOleObject - , , .
|
|
. - , , . Delphi Variant, , .
Excel.Application , , XLApp, Variant. .
.
Var
XLApp,Sheet,Colum:Variant;
index,i:Integer;
Begin
XLApp:= CreateOleObject('Excel.Application'); { Excel XLAp p. }
XLApp.Visible:=true; { Excel. }
XLApp.Workbooks.Add(-4167); { . , . }
XLApp.Workbooks[1].WorkSheets[1].Name:=''; { tv . , " 1 ". }
{ Excel .
. . Colum. }
Colum:=XLApp.Workbooks[1].WorkSheets[''].Columns;
Colum.Columns[1].ColumnWidth:=20; { }
Colum.Columns[2].ColumnWidth:=20;
Colum.Columns[3].ColumnWidth:=20;
Colum.Columns[4].ColumnWidth:=20;
Colum.Columns[5].ColumnWidth:=20;
Colum:=XLApp.Workbooks[1].WorkSheets[''].Rows; { }
Colum.Rows[2].Font.Bold:=true;
Colum.Rows[1].Font.Bold:=true;
Colum.Rows[1].Font.Color:=clBlue;
Colum.Rows[1].Font.Size:=14;
{ . Sheet. , , Sheet.Cells[, ].
Sheet:=XLApp.Workbooks[1].WorkSheets['']; {}
Sheet.Cells[1,2]:=' ';
Sheet.Cells[2,1]:='';
Sheet.Cells[2,2]:='';
Sheet.Cells[2,3]:='e-mail';
Sheet.Cells[2,4]:='';
Sheet.Cells[2,5]:=' ';
{ }I
ndex:=3;