帮助里不是有例子吗 ? procedure TForm1.FormCreate(Sender: TObject);var I : Integer;begin { First, initialize the page control } PageControl1.TabWidth := PageControl1.ClientWidth div 4 - 1; PageControl1.ActivePage := PageControl1.Pages[0]; { set up the scrollbar to reflect the structure of the page control} with ScrollBar1 do begin Max := PageControl1.PageCount - 1; Min := 0; SmallChange := 1; { set LargeChange to a single row of tabs } LargeChange := PageControl1.ClientWidth div PageControl1.TabWidth; end;end;procedure TForm1.PageControl1Change(Sender: TObject);begin with Sender as TPageControl do ScrollBar1.Position := ActivePage.PageIndex;end;procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);begin PageControl1.ActivePage := PageControl1.Pages[ScrollPos]; end;
case TScrollCode(ScrollCode) of scPosition : begin ///...//// 定位滑块位置,并放开鼠标按键 end; scTrack : begin //////// 滑块时 end; scLineUp : begin //////点左边(上边)的按钮时 end; scLineDown : begin /////点下边的按钮时 end ; scPageUp : begin ////上翻页时 end; scPageDown : begin ////下翻页时 end; scTop : begin ////滑块移动到左边(上面)时; end; scBottom : begin /////滑块移动到右边(下面)时; end; scEndScroll : begin ////停止滑动时 end; end;
scLineUp User clicked the top or left scroll arrow or pressed the Up or Left arrow key. scLineDown User clicked the bottom or right scroll arrow or pressed the Down or Right arrow key. scPageUp User clicked the area to the left of the thumb tab or pressed the PgUp key. scPageDown User clicked the area to the right of the thumb tab or pressed the PgDn key. scPosition User positioned the thumb tab and released it. scTrack User is moving the thumb tab. scTop User moved the thumb tab to the top or far left on the scroll bar.scBottom User moved the thumb tab to the bottom or far right on the scroll bar. scEndScroll User finished moving the thumb tab on the scroll bar
procedure TForm1.FormCreate(Sender: TObject);var
I : Integer;begin { First, initialize the page control }
PageControl1.TabWidth := PageControl1.ClientWidth div 4 - 1; PageControl1.ActivePage := PageControl1.Pages[0]; { set up the scrollbar to reflect the structure of the page control}
with ScrollBar1 do
begin
Max := PageControl1.PageCount - 1;
Min := 0;
SmallChange := 1;
{ set LargeChange to a single row of tabs }
LargeChange := PageControl1.ClientWidth div PageControl1.TabWidth;
end;end;procedure TForm1.PageControl1Change(Sender: TObject);begin
with Sender as TPageControl do
ScrollBar1.Position := ActivePage.PageIndex;end;procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);begin
PageControl1.ActivePage := PageControl1.Pages[ScrollPos];
end;
可是如何使他也能往左滚动呢!!
有ERP源码和文档
http://www.czrx.com/get.asp?get=iamcfr
scPosition :
begin
///...//// 定位滑块位置,并放开鼠标按键
end;
scTrack :
begin
//////// 滑块时
end;
scLineUp :
begin
//////点左边(上边)的按钮时
end;
scLineDown :
begin
/////点下边的按钮时
end ;
scPageUp :
begin
////上翻页时
end;
scPageDown :
begin
////下翻页时
end;
scTop :
begin
////滑块移动到左边(上面)时;
end;
scBottom :
begin
/////滑块移动到右边(下面)时;
end;
scEndScroll :
begin
////停止滑动时
end;
end;
User clicked the top or left scroll arrow or pressed the Up or Left arrow key.
scLineDown
User clicked the bottom or right scroll arrow or pressed the Down or Right arrow key.
scPageUp
User clicked the area to the left of the thumb tab or pressed the PgUp key.
scPageDown
User clicked the area to the right of the thumb tab or pressed the PgDn key.
scPosition
User positioned the thumb tab and released it.
scTrack
User is moving the thumb tab.
scTop
User moved the thumb tab to the top or far left on the scroll bar.scBottom
User moved the thumb tab to the bottom or far right on the scroll bar.
scEndScroll
User finished moving the thumb tab on the scroll bar