469,283 Members | 2,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

Need a command for scrolling in continuous form.

176 100+
Hello.

I would like to replace the defalt Scroll Bars with custom buttons in a continuous form.

I've tryed to make command buttons with the goto next/previous record macros, but those aren't acting in the same way as the scroll bars, for example, the control has to be focused in order for the goto next/previous record macros to work.

So, is there a way to compose a buttons that will imitate the scroll bar?

Much thanks, Michael.
Jan 29 '07 #1
4 7546
ADezii
8,800 Expert 8TB
Hello.

I would like to replace the defalt Scroll Bars with custom buttons in a continuous form.

I've tryed to make command buttons with the goto next/previous record macros, but those aren't acting in the same way as the scroll bars, for example, the control has to be focused in order for the goto next/previous record macros to work.

So, is there a way to compose a buttons that will imitate the scroll bar?

Much thanks, Michael.
The simplest way to mimic the scrolling behavior on a Continuous Form via Command Buttons is as follows:
Expand|Select|Wrap|Line Numbers
  1. 'In the Click() Event of a Command Button in the Form Footer with the
  2. Caption Scroll Up, place the following single line of code
  3. Private Sub cmdScrollUp_Click()
  4.   SendKeys "{PGUP}"
  5. End Sub
Expand|Select|Wrap|Line Numbers
  1. 'In the Click() Event of a Command Button in the Form Footer with the
  2. Caption Scroll Down, place the following single line of code
  3. Private Sub cmdScrollDown_Click()
  4.   SendKeys "{PGDN}"
  5. End Sub
Jan 29 '07 #2
NeoPa
32,173 Expert Mod 16PB
I think that to imitate the scrollbars with full-functionality is actually quite involved as there are various things the scroll bars respond to :
Clicking above / below; dragging; keystrokes; etc.
Some of the more important (to you) functionality can be mimicked but it's quite detailed work.
Jan 29 '07 #3
ADezii
8,800 Expert 8TB
I think that to imitate the scrollbars with full-functionality is actually quite involved as there are various things the scroll bars respond to :
Clicking above / below; dragging; keystrokes; etc.
Some of the more important (to you) functionality can be mimicked but it's quite detailed work.
It would seem as though imitating fully functional Scroll Bars via Command Buttons would be next to impossible until I had a brainstorm. What do you think about using the Auto Repeat property of a Command Button? As long as this Property is set to True, code within the Click() Event of the button will execute as long as the button is pressed. With an appropriate delay factor programmed in to slow down Record Navigation, it may not be as difficult as we think. Of course the other factors that you mentioned such as Clicking above / below; dragging; keystrokes would be next to impossible to duplicate. Checking for BOF and EOF would probably be difficult also because of the Repeat factor. Please excuse me if I am ranting on - just wanted your input.
Jan 29 '07 #4
NeoPa
32,173 Expert Mod 16PB
Not at all ADezii, I'm always pleased to discuss matters towards anyone's better understanding (mine included).
Let me first issue another request to initiate Private Message contact though. Can you let me know if you have any difficulty with this (in here or by PM).
Certainly the auto-repeat feature could add similarity to the effect. I would also say that PageUp & PageDown controls could also be added in such a way as to look like the scroll bar. I wouldn't do it myself unless for an exercise, and I wouldn't want to take someone through it on here unless they could communicate well.
I've implemented record level controls on a bound form before to replace the defaults but I would see Scroll bars as an extra level of complication.
Jan 29 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by avanti | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.