Модератор: Модераторы
Procedure TForm1.Button1Click(Sender: TObject);
Var
aPaintBox: TPaintBox;
i: Integer;
Begin
aPaintBox := TPaintBox.Create(Form1);
aPaintBox.Parent := Form1;
aPaintBox.Canvas.Brush.Color := clBtnFace;
aPaintBox.Canvas.FillRect(aPaintBox.Canvas.ClipRect);
aPaintBox.Canvas.Brush.Color := clHighlight;
Application.ProcessMessages;
For i := 0 To aPaintBox.Width - 1 Do
Begin
aPaintBox.Canvas.FillRect(0, 0, i, aPaintBox.Height);
Application.ProcessMessages;
Sleep(50);
End;
end;
Procedure TForm1.SetValue(Const aID: Integer);
Const
aMin = 0;
aMax = 100;
Begin
With PaintBox1.Canvas Do
Begin
Caption := IntToStr(aID);
Brush.Color := clBtnFace;
FillRect(ClipRect);
Brush.Color := clHighlight;
FillRect(0, 0, Trunc((aID / aMax) * PaintBox1.Width), Height);
Caption := Caption + ':' + IntToStr(Trunc((aID / aMax)));
End;
End;
Сейчас этот форум просматривают: MailRu[bot] и гости: 46