14.10.2011, 19:10
Гуру
Регистрация: 09.03.2009
Адрес: На курорте, из окна вижу теплое Баренцево море. Бррр.
Сообщения: 4,723
Репутация: 52347
Видимо что-то в таком ключе надо?
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Jpeg, DBCtrls, DB, DBClient, Grids, DBGrids, CheckLst;
type
TForm1 = class(TForm)
CheckListBox1: TCheckListBox;
Memo1: TMemo;
procedure CheckListBox1DblClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Memo1DblClick(Sender: TObject);
procedure CheckListBox1ClickCheck(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TCheckItemProperties = class
Weight: Real;
Height: Integer;
Old: Integer;
constructor Create(W: Real; H, O: Integer);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.CheckListBox1DblClick(Sender: TObject);
begin
with TCheckItemProperties(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex])
do ShowMessage(Format('%5.2f %d %d',[Weight, Height, Old]));
end;
constructor TCheckItemProperties.Create(W: Real; H, O: Integer);
begin
Weight := W;
Height := H;
Old := O;
end;
procedure TForm1.FormCreate(Sender: TObject);
Var i: Integer;
begin
for i := 0 to CheckListBox1.Items.Count - 1
do begin
CheckListBox1.Items.Objects[i] := TCheckItemProperties.Create(1.1+i, 156, 21);
end;
end;
procedure TForm1.Memo1DblClick(Sender: TObject);
begin
if CheckListBox1.ItemIndex = -1 then Exit;
CheckListBox1.Items[CheckListBox1.ItemIndex] := Memo1.Lines[0]
end;
procedure TForm1.CheckListBox1ClickCheck(Sender: TObject);
begin
Memo1.Lines[0] := CheckListBox1.Items[CheckListBox1.ItemIndex];
end;
end.
__________________
Жизнь такова какова она есть и больше никакова.
Помогаю за спасибо.