Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
MFC
TRY
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

DDX_FieldScroll 

The DDX_FieldScroll function synchronizes the scroll position of a scroll bar control in a record view and an int field data member of a recordset associated with the record view (or with whatever integer variable you choose to map it to).


void AFXAPI DDX_FieldScroll(
   CDataExchange* pDX,
   int nIDC,
   int& value,
   CRecordset* pRecordset 
);
void AFXAPI DDX_FieldScroll(
   CDataExchange* pDX,
   int nIDC,
   int& value,
   CDaoRecordset* pRecordset 
);

Parameters

pDX

A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC*

The ID of the first in a group (with style WS_GROUP) of adjacent radio button controls in the CRecordView or CDaoRecordView object.

value

A reference to a field data member in the associated CRecordset or CDaoRecordset object.

pRecordset

A pointer to the CRecordset or CDaoRecordset object with which data is exchanged.

When moving data from the recordset to the control, this function sets the scroll position of the scroll bar control to the value specified in value. On a transfer from the recordset to the control, if the recordset field is Null, the scroll bar control is set to 0. On a transfer from control to recordset, if the control is empty, the value of the recordset field is 0.

Use the first version if you are working with the ODBC-based classes. Use the second version if you are working with the DAO-based classes.

For more information about DDX, see Dialog Data Exchange and Validation. For examples and more information about DDX for CRecordView and CDaoRecordView fields, see the article Record Views.

See DDX_FieldText for a general DDX_Field example. Calls to DDX_FieldScroll would be similar.

Community Additions

ADD
Show:
© 2015 Microsoft