Bill:
I added a property checkscrolling to my base form to control scrolling.
I added a method to my scrollentry form class as follows:
* BEGIN MVSCROLLENTRYFORM.SCROLLFORM()
* Description: This method completely replaces the behavior in mvEntryForm. DO NOT call
* dodefault().
* Parameters: -
* Returns:
* Notes: 1.
* 2.
* Revisions: 05/26/1999 - MWT
* - Created
* 07/15/1999 - JLW
* - The movement of the scroll bar is a ratio.
* 09/09/1999 - MWT
* - Added a very small inkey() delay to allow textboxes' selectonentry to
* work correctly.
lparameter toControl
local lnControlPosition
local loObject
local lnSign
local lnMove
if upper(toControl.baseclass) = 'FORM'
RETURN .T.
endif
lnControlPosition = objtoclient(toControl,1) && Returns relative top to form
with thisform.ScrollPanel1
do case
case lnControlPosition < .top
lnMove = .top - lnControlPosition
lnSign = -1
case (lncontrolPosition + toControl.height) > .top + .height
lnMove = lnControlPosition - (.top + .height)
lnSign = 1
otherwise
lnMove = 0
endcase
if lnMove # 0
if lnMove < .scrollv.BigMove
lnMove = .scrollv.BigMove
else
* Adding BigMove is actually a Fudge Factor.
lnMove = round((lnMove / .scrollv.Ratio),0) + .scrollv.BigMove
endif
.scrollv.ScrollAction(lnMove * lnSign)
inkey(0.00001,"H")
endif
endwith
* END MVSCROLLENTRYFORM.SCROLLFORM()
In all controls that can be used I added the following code to the GotFocus Event: (textbox, combo, checkbox, editbox)
* BEGIN FORM1.MVTEXTBOX.GOTFOCUS()
* Description:
* Parameters: -
* Returns:
* Notes: 1.
* 2.
* Revisions: 04/27/1999 - MWT
* - Created
* 05/26/1999 - MWT
* - Changed to check a property on mvForm instead of checking to see if the form
* - used scrollbars. With ScrollPanel, VFP scrollbars are NOT USED.
* 09/08/1999 - MWT
* - Moved the dodefault() to the end to allow "SelectOnEntry" to stay
* highlighted when the screen needs to scroll.
* 9/21/99 - JKJ
* - Comment property only displays in the statusbar if the textbox does not
* belong to a grid.
if thisform.CheckScrolling
thisform.ScrollForm(this)
endif
* if vartype(thisform.mvStatusbar1) == "O" and this.parent.class <> "Column"
* local lnWhichPanel
* lnWhichPanel = thisform.StatusComment
* thisform.mvStatusbar1.Panels[lnWhichPanel].text = this.Comment
* endif
dodefault()
* END FORM1.MVTEXTBOX.GOTFOCUS()
HTH
Mike
Mike