We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
procedure TForm2.VirtualStringTree1BeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect); procedure drawProgress(AWidth: Integer; APercent: Real; ASteps: Integer; ALeft: Integer = 1); var r: TRect; h, n: Integer; begin if APercent > 1 then APercent := 1 else if APercent = 0 then Exit;//nothing to draw h := Round(CellRect.Height / ASteps) - 1; r.Top := CellRect.bottom - h - 1; r.Left := ALeft; r.Width := AWidth; TargetCanvas.Brush.Color := clSkyBlue; n := Ceil(APercent * ASteps);//how many rect to draw? while n > 0 do begin r.Height := h; TargetCanvas.FillRect(r); Dec(r.Top, 1 + h); Dec(n); end; end; begin drawProgress(10, 1, 7); drawProgress(30, Percents, 7, 1 + 10 + 1); end;
so i cannot set it to redraw the animated bar from 0 to 100 any idea how to tweak this ?
Percents := Percents + 0.025;
var Percents: Real; procedure TForm2.Timer1Timer(Sender: TObject); begin if Percents > 1 then Percents := 0 else Percents := Percents + 0.025; VirtualStringTree1.Repaint; end;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.