whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

85 Visitors Online


 
...create a TProgressBar in a TListView column?
Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Print tip ]  

Tip Rating (10):  
     




procedure TForm1.Button1Click(Sender: TObject);
var
  
r: TRect;
  pb: TProgressBar;
begin
  
Listview1.Columns.Add.Width := 100;
  Listview1.Columns.Add.Width := 200;
  Listview1.ViewStyle         := vsReport;
  Listview1.Items.Add.Caption := 'Text';

  r := Listview1.Items[0].DisplayRect(drBounds);
  r.Left  := r.Left + Listview1.columns[0].Width;
  r.Right := r.Left + Listview1.columns[1].Width;

  pb := TProgressBar.Create(Self);
  pb.Parent := Listview1;
  pb.BoundsRect := r;
  pb.Position := 30;
  Listview1.Items[0].Data := pb;
end;


// Change the ProgressBar Position
// ProgressBar Position ändern

procedure TForm1.Button2Click(Sender: TObject);
var
  
pb: TProgressBar;
begin
  
pb := TProgressBar(Listview1.Items[0].Data);
  pb.StepIt;
end;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners