1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
| procedure TForm1.FormCreate(Sender: TObject); begin StringGrid1.Options := StringGrid1.Options + [goEditing] + [goTabs]; end;
procedure grdColWidth(grd: TStringGrid; min: Word); var i, j, tmp, max: Word; const dx = 5;
begin with grd do begin for j := 0 to (ColCount -1) do begin max := 0; for i := 0 to (RowCount - 1 ) do begin tmp := Canvas.TextWidth(Cells[j, i]); if tmp > max then max := tmp end; if max > min then ColWidths[j] := max + GridLineWidth + dx end end end;
procedure TForm1.TabSheet2Show(Sender: TObject); begin Weiter3.Enabled := false; grdColWidth(StringGrid1, 30);
StringGrid1.Cells [0,0] := 'Solldruck'; StringGrid1.Cells [0,1] := 'Angestrebter Druckunterschied'; StringGrid1.Cells [0,2] := 'notwendige Druckunterschied'; StringGrid1.Cells [0,3] := 'Angestrebter Offsetdruck'; StringGrid1.Cells [0,4] := 'Startspannung Amplitude'; StringGrid1.Cells [0,5] := 'Startspannung Offsetdruck'; StringGrid1.Cells [0,6] := 'Erlaubte Befüllung pro Stunde';
StringGrid1.Cells [1,0] := SolldruckKammer.Text; StringGrid1.Cells [1,1] := angestrebteDeltaDruck.Text; StringGrid1.Cells [1,2] := notwendigeDeltaDruck.Text; StringGrid1.Cells [1,3] := angestrebteOffsetdruck.Text; StringGrid1.Cells [1,4] := StartSpgAmpl.Text; StringGrid1.Cells [1,5] := StartspgOffsetdruck.Text; StringGrid1.Cells [1,6] := erlaubteBefuellung.Text; end; |