Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrolling Forms
Message
 
To
04/06/1998 12:03:50
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00086569
Message ID:
00106803
Views:
61
>Yes, thanks. Could you send me some code to get started. Nice move.
>
>thanks,
>
>ray

Ray,

I apologize for the delay. I've been focused on moving into a new home, starting a new job, and developing a contracting project. Making time to breathe has been a concern, too.

Here's some code for you to try. In the form, place two scroll bars anywhere on the form and make one vertical, the other horitzontal. Make sure the object names and the sample code match.

A couple things to keep in mind is: 1) This may not be the only/best way to do this (but it worked for me); 2) You'll need a bitmap of the lower-right portion of a window (the square piece connecting the vertical and horitzonal scroll bars) and call it "GrabSize". Without it, there may be a clear/blank area there instead.

Good luck!

Michael Reynolds
Santa Barbara, CA

**********************

CHANGE EVENT FOR VERT SCROLL

* ----- create factor constant

ScrollFactor = ;
32767 / (THISFORM.PageFrame1.Height - (THISFORM.Height - 20))

* ----- set top property of page frame
THISFORM.PageFrame1.Top = 0 - THIS.Value / ScrollFactor

* ----- refresh form
THISFORM.PageFrame1.Refresh

*********************

CHANGE EVENT FOR HORIZ SCROLL

* ----- create factor constant
ScrollFactor = ;
32767 / (THISFORM.PageFrame1.Width - (THISFORM.Width - 16))

* ----- set top property of page frame
THISFORM.PageFrame1.Left = 0 - (THIS.Value / ScrollFactor)

* ----- refresh form
THISFORM.PageFrame1.Refresh

**********************

INIT EVENT FOR FORM

* ----- set scroll size according to resolution
THIS.ScrollSize = IIF(SCOLS() > 99, 16, 13)

* ----- set properties
THIS.VertScroll.SmallChange = 1500
THIS.HorizScroll.SmallChange = 2000
THIS.VertScroll.LargeChange = 4000
THIS.HorizScroll.LargeChange = 6000

* ----- set win pos
THIS.Left = &pcAlias..wLeft
THIS.Top = &pcAlias..wTop
THIS.Width = &pcAlias..wWidth
THIS.Height = &pcAlias..wHeight

* ----- locate bitmap in bottom right corner
THIS.GrabSize.Move((THIS.Width - THIS.ScrollSize), ;
THIS.Height - THIS.ScrollSize)
THIS.GrabSize.Height = THIS.Height
THIS.GrabSize.Height = THIS.ScrollSize
THIS.GrabSize.Width = THIS.ScrollSize
THIS.GrabSize.Left = THIS.Width - THIS.ScrollSize
THIS.GrabSize.Top = THIS.Height - THIS.ScrollSize

THIS.Resize()

************************

RESIZE EVENT FOR FORM

* ----- move bitmap around
THIS.GrabSize.Left = THIS.Width - THIS.ScrollSize
THIS.GrabSize.Top = THIS.Height - THIS.ScrollSize

* ----- move them
THIS.VertScroll.Move(THIS.Width - THIS.ScrollSize, 0)
THIS.HorizScroll.Move(0, THIS.Height - THIS.ScrollSize)

* ----- resize scroll bars
THIS.VertScroll.Height = THIS.Height
THIS.VertScroll.Height = THIS.Height - THIS.ScrollSize
THIS.VertScroll.Width = THIS.ScrollSize
THIS.VertScroll.Left = THIS.Width - THIS.ScrollSize
THIS.HorizScroll.Width = THIS.Width
THIS.HorizScroll.Width = THIS.Width - THIS.ScrollSize
THIS.HorizScroll.Height = THIS.ScrollSize
THIS.HorizScroll.Top = THIS.Height - THIS.ScrollSize

* ----- refresh form
THIS.PageFrame1.Refresh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform