, , , . Events Object Inspector ComboBox1 OnChange () : NewEdit. , :
procedure TPagesDlg.NewEdit(Sender: Tobject);
var i: integer;
begin
{i - }
i:=ComboBoxl.ItemIndex+ 1;
if i>0 then begin
{ }
Editl.Text:= StringGrid1.Cells[0, i]; { 1- }
Edit2.Text:= StringGrid1.Cells[l, i]; { }
Edit3.Text:= StringGrid1.Cells[2, i]; { }
Edit4.Text:= StringGrid1.Cells[3, i];
end; end;
NewComboBox.
() TPagesDlg ( ) interface :
type
{ }
TPagesDlg = class(TForm)
{ }
procedure NewComboBox;
implementation :
Procedure TPagesDlg.NewComboBox;
var i, j: integer;
begin { }
j:=ComboBox1.ItemIndex; { }
ComboBox1.Clear;
for i:=1 to N do { N I..}
{ }
ComboBox1.Items.Add(StringGrid1.Cells[0, i]);
{ j}
ComboBox1.ItemIndex:=j; end;
23. , , , .
24. .
procedureTPagesDlg.N6Click(Sender: Tobject);
{ N6 - , )
var i: integer;
Begin
{ }
i:=ComboBox1.ItemIndex+1;
if PageControl1.ActivePage=TabSheet2 then
begin { a}
StringGrid1.Cells[0, i]:=Editl.Text;
{ }
StringGrid1.Cells[l, i]:=Edit2.Text;
StringGridl. Cells[2, i]:= Edit3.Text;
StringGrid1.Cells[3, i]:= Edit4.Text; end;
{ - }
else NewEdit(ComboBox1);
{ }
NewComboBox; end;
25. .
procedure TpagesDlg.ButtonlClick(Sender; Tobject);
Begin
if ComboBox1.Itemindex = 0 then { }
ComboBox1.Itemindex:=N-1 else
{ }
|
|
ComboBox1.Itemindex:= ComboBox1.Itemindex -1; { }
NewEdit(ComboBox1); end;
26. .
.
27. .
, , - . , . , . , . , , , .
:
1. , .
2. , , Edit5 . , .
3. → → , .
4. .
5. .
6. , .
.6 .7
. 8