我是想实现listbox的滚动条能够随我的内容往下滚动,怎样实现,谢谢
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ListBox1.Items.Append(DateTimetostr(now)+' 程序占用cpu资源:'+x);
Timer1.Interval:=10000;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ListBox1.Items.Append(DateTimetostr(now)+' 程序占用cpu资源:'+x);
Timer1.Interval:=10000;
end;
var SI:TScrollInfo;
begin
ListBox1.Items.Append(DateTimetostr(now)+' 程序占用cpu资源:'+x);
Timer1.Interval:=10000;
SI.cbSize:=SizeOf(SI);
SI.fMask:=SIF_POS;
GetScrollInfo(ListBox1.Handle,SB_VERT,SI);
ListBox1.Perform(WM_VSCROLL,MakeLong(SB_THUMBPOSITION,SI.nPos+1),0);
end;