ComponentOne VSView 8.0
FocusTrack Property

Returns or sets whether the control should scroll to keep visible the child with focus.

Syntax

[form!]VSViewPort.FocusTrack[ = {True | False} ]

Remarks

This property is useful if you want to implement a form-like data entry screen, and the form is larger than the control.

If you place the fields in a VSViewPort control and set the FocusTrack property to True, the control will scroll automatically as the user presses the TAB key, so the field that has the focus is visible to the user.

In many types of forms, fields have labels on their left or top. To keep the labels visible as well as the field, use the FocusMarginLeft and FocusMarginTop properties. These properties specify the size of the margins (in twips) that should be added to the left and top of the control with the focus so that the labels remain visible.

The picture below illustrates the behavior of the FocusMarginLeft and FocusMarginTop properties:

Note: The FocusTrack property works automatically as long as the controls getting the focus are directly contained in the VSViewPort control. If the control getting the focus is contained in another control (for example, a picture box inside the VSViewPort control), then VSViewPort will not get the notifications it needs to track the focus automatically. In these cases, you have to add code to the child control's GetFocus event and set the FocusTrack property to True explicitly.

For example, assuming you have an array of text boxes in a frame or picture box which in turn is in a VSViewPort control, you could track the control with the focus using this code:

Private Sub txtTextBoxArray_GotFocus(Index As Integer)

' scroll the control with the focus into view

VSViewPort8.FocusTrack = True

End Sub

Data Type

Boolean

Default Value

False

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback