Для строки Таблицы используется номер сессии: NumberBox1.Value, причем, так как NumberBox1.Value имеет размерность Double, а для таблицы нужно целое число, можно NumberBox1.Value округлить: Round ().
В конечном итоге для 3-х сессий получим следующий код:
procedure TForm1.PaintBox1Paint (Sender: TObject; Canvas: TCanvas);
var
i: Integer;
begin
Sender:=PaintBox1;
with Canvas do
if (Path.Count> 0) and (BeginScene) then
try
Stroke.Kind:=TBrushKind.Solid;
if NumberBox1.Value = 1 then //Если первая сессия
begin //Начальные установки – черный цвет на блом фоне
Stroke.Color:= TAlphaColors. Black;
Stroke.Thickness:= 2;
DrawPath (Path,1);
end;
if NumberBox1.Value = 2 then
begin
Stroke.Color:= TAlphaColors. Black;//Сессия 1
Stroke.Thickness:= 2;
DrawPath (Path,1);
Stroke.Thickness:= StrToInt (StringGrid1.Cells [0, 2]); //Сессия 1
Stroke.Color:= Round (StrToFloat (StringGrid1.Cells [1, 2]));