
23.10.2014, 18:59
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, DB, DBTables;
type
TDBGrid = class(DBGrids.TDBGrid)
end;
TForm1 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Edit1: TEdit;
procedure DataSource1DataChange(Sender: TObject; Field: TField);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField);
begin
if Field=nil then Edit1.Top:=DBGrid1.CellRect(DBGrid1.Col, DBGrid1.Row).Top+DBGrid1.Top;
end;
end.
Код:
object Form1: TForm1
Left = 192
Top = 124
Width = 1305
Height = 675
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object DBGrid1: TDBGrid
Left = 200
Top = 224
Width = 320
Height = 225
DataSource = DataSource1
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
end
object Edit1: TEdit
Left = 552
Top = 120
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
end
object Table1: TTable
Active = True
DatabaseName = 'DBDEMOS'
TableName = 'country.db'
Left = 200
Top = 136
end
object DataSource1: TDataSource
DataSet = Table1
OnDataChange = DataSource1DataChange
Left = 264
Top = 136
end
end
__________________
Пишу программы за еду.
__________________
|