Board index » delphi » TScrollBox Question - URGENT -

TScrollBox Question - URGENT -

Hi All,

Is there a Way to Control the ScrollPos of the TScrollBox.

I've got 2 scrollboxes named ScrollBox1,ScrollBox2.

Now, when I scroll box number 1, box number 2 has to go to the same
position.(Vertically).

Arie.

question

 

Re:TScrollBox Question - URGENT -


On Mon, 13 Dec 1999 11:31:57 +0100 Arie van Someren wrote:

Quote
> Hi All,

> Is there a Way to Control the ScrollPos of the TScrollBox.

> I've got 2 scrollboxes named ScrollBox1,ScrollBox2.

> Now, when I scroll box number 1, box number 2 has to go to the same
> position.(Vertically).

In the proper event do sth. like:
ScrollBox2.VertScrollBar.Position:= ScrollBox1.VertScrollBar.Position;

Bye, Udo

Re:TScrollBox Question - URGENT -


Udo,

First I want to thank you for your time and effort...

But,

The two ScrollBoxes are placed next to eachother, they are the same height
and have the sam amount of 'Lines'
The problem is that i want to make the VertScrollBar of the ScrollBox on the
left invisible(So that you dont see 2 ScrollBars). When i do that, The
VertScrollBar.Position of the box on the left is not accessible; it isn't
updated..

THAT'S THE PROBLEM!!

Got an Idea?

Arie van Someren
Application Developer
UPC - Nederland

Re:TScrollBox Question - URGENT -


On Mon, 13 Dec 1999 15:05:32 +0100 Arie van Someren wrote:

Quote
> Udo,

> First I want to thank you for your time and effort...

> But,

> The two ScrollBoxes are placed next to eachother, they are the same height
> and have the sam amount of 'Lines'
> The problem is that i want to make the VertScrollBar of the ScrollBox on the
> left invisible(So that you dont see 2 ScrollBars). When i do that, The
> VertScrollBar.Position of the box on the left is not accessible; it isn't
> updated..

> THAT'S THE PROBLEM!!

Then you maybe have to go via messages. But for that I have to dig
into it deeper (which is a problem regarding my time  :((( sorry)

Bye, Udo

Re:TScrollBox Question - URGENT -


Ok, Thanx anyway!!!

Arie

Re:TScrollBox Question - URGENT -


In article <8331pc$p1...@news.telekabel.nl>, "Arie van Someren"

Quote
<impact_s...@Hotmail.com> writes:
>The two ScrollBoxes are placed next to eachother, they are the same height
>and have the sam amount of 'Lines'
>The problem is that i want to make the VertScrollBar of the ScrollBox on the
>left invisible(So that you dont see 2 ScrollBars). When i do that, The
>VertScrollBar.Position of the box on the left is not accessible; it isn't
>updated..

>THAT'S THE PROBLEM!!

>Got an Idea?

Bring the right-hand scrollbox to the front.
Position the RH scrollbox to LHScrollBox.Left + LHScrollBox.Width -
WidthOfScrollBar.
Voila!
WidthOfScrollBar is 20 (I believe).

BTW if you're scrolling two memos, I have a TMasterMemo which will control
another memo in this fashion, and they can be daisy-chained.

Alan Lloyd
alangll...@aol.com.

Re:TScrollBox Question - URGENT -


Have you tried using the Windows API?
Something like :
  p := GetScrollPos(GridRight.Handle, SB_Vert);
  SetScrollPos(GridLeft.Handle, SB_Vert, p, True);

Otherwise the way that I normally synchronise two grids is using
OnTopLeftChanged

procedure TForm1.grdConstCurrTopLeftChanged(Sender: TObject);
var t:integer;
begin
  t := (Sender as tStringGrid).TopRow;
  grdConstCurr.  TopRow     := t;
  grdEngCurr.    TopRow     := t;
  grdPortCurr.   TopRow     := t;
end;

Marc Rohloff

Re:TScrollBox Question - URGENT -


Thanx, that's  IT!!!

Quote
Marc Rohloff <NoSpam_MarcRohl...@email.com> wrote in message

news:3857430b.0@news1.mweb.co.za...
Quote
> Have you tried using the Windows API?
> Something like :
>   p := GetScrollPos(GridRight.Handle, SB_Vert);
>   SetScrollPos(GridLeft.Handle, SB_Vert, p, True);

> Otherwise the way that I normally synchronise two grids is using
> OnTopLeftChanged

> procedure TForm1.grdConstCurrTopLeftChanged(Sender: TObject);
> var t:integer;
> begin
>   t := (Sender as tStringGrid).TopRow;
>   grdConstCurr.  TopRow     := t;
>   grdEngCurr.    TopRow     := t;
>   grdPortCurr.   TopRow     := t;
> end;

> Marc Rohloff

Other Threads