Board index » cppbuilder » Scrolling a TScrollBox by using at TButton

Scrolling a TScrollBox by using at TButton

How can I scroll a TScrollBox without using the built in scroll bars. I need
the built in scroll bars to not be visible, and want to use a TButton to
scroll the box.

I tried this, but it did not work:

ScrollBox->HorzScrollBar->Position++;

-Aaron

 

Re:Scrolling a TScrollBox by using at TButton


try following instead:

ScrollBox->HorzScrollBar->Position = ScrollBox->HorzScrollBar->Position + X;

Henrik

Aaron Bockover <abocko...@crevasoft.com> schrieb in im Newsbeitrag:
3b4d3500_1@dnews...

Quote
> How can I scroll a TScrollBox without using the built in scroll bars. I
need
> the built in scroll bars to not be visible, and want to use a TButton to
> scroll the box.

> I tried this, but it did not work:

> ScrollBox->HorzScrollBar->Position++;

> -Aaron

Re:Scrolling a TScrollBox by using at TButton


Hi,

The component I'm using is actuall called TScrollPanel, it's a TPanel with
TScrollBox properties. I replaced the TScrollPanel with a TScrollBox to see
if the code I used and the code you gave would work, but it didn't with
either control. I think there is something more complicated?

I know this code will work for scrolling a TMemo, but it does not work on
the TScrollBox or TScrollPanel:

Memo1->Perform(EM_LINESCROLL,0,1);

Thanks,

Aaron

Quote
"Henrik Skupin" <h.sku...@web.de> wrote in message news:3b4d53ac_1@dnews...
> try following instead:

> ScrollBox->HorzScrollBar->Position = ScrollBox->HorzScrollBar->Position +
X;

> Henrik

> Aaron Bockover <abocko...@crevasoft.com> schrieb in im Newsbeitrag:
> 3b4d3500_1@dnews...
> > How can I scroll a TScrollBox without using the built in scroll bars. I
> need
> > the built in scroll bars to not be visible, and want to use a TButton to
> > scroll the box.

> > I tried this, but it did not work:

> > ScrollBox->HorzScrollBar->Position++;

> > -Aaron

Re:Scrolling a TScrollBox by using at TButton


Try this one:

ScrollBox1->ScrollBy(10,0);

This will scroll it to the right by 10 pixels.  Of course, if the parameters
were (0,10), it would scroll vertically.  These integers represent pixels,
and if you make them negative, it will scroll in the opposite direction.

-Jeffrey

"Aaron Bockover" <abocko...@crevasoft.com> wrote in
news:3b4da4b8_2@dnews:

Quote
> Hi,

> The component I'm using is actuall called TScrollPanel, it's a TPanel
> with TScrollBox properties. I replaced the TScrollPanel with a
> TScrollBox to see if the code I used and the code you gave would work,
> but it didn't with either control. I think there is something more
> complicated?

> I know this code will work for scrolling a TMemo, but it does not work
> on the TScrollBox or TScrollPanel:

> Memo1->Perform(EM_LINESCROLL,0,1);

> Thanks,

> Aaron

<snip>

--
_____________________________
Jeffrey W. Tickle
tickl...@jtsoft.net
http://www.jtsoft.net

Re:Scrolling a TScrollBox by using at TButton


Thanks!

"Jeffrey W. Tickle" <tickl...@jtsoft.net> wrote in message
news:Xns90DCA05BD70FDticklejwjtsoftnet@207.105.83.65...

Quote
> Try this one:

> ScrollBox1->ScrollBy(10,0);

> This will scroll it to the right by 10 pixels.  Of course, if the
parameters
> were (0,10), it would scroll vertically.  These integers represent pixels,
> and if you make them negative, it will scroll in the opposite direction.

> -Jeffrey

> "Aaron Bockover" <abocko...@crevasoft.com> wrote in
> news:3b4da4b8_2@dnews:

> > Hi,

> > The component I'm using is actuall called TScrollPanel, it's a TPanel
> > with TScrollBox properties. I replaced the TScrollPanel with a
> > TScrollBox to see if the code I used and the code you gave would work,
> > but it didn't with either control. I think there is something more
> > complicated?

> > I know this code will work for scrolling a TMemo, but it does not work
> > on the TScrollBox or TScrollPanel:

> > Memo1->Perform(EM_LINESCROLL,0,1);

> > Thanks,

> > Aaron

> <snip>

> --
> _____________________________
> Jeffrey W. Tickle
> tickl...@jtsoft.net
> http://www.jtsoft.net

Other Threads