다음을 통해 공유


DDX_FieldRadio

The DDX_FieldRadio function associates a zero-based int member variable of a record view's recordset with the currently selected radio button in a group of radio buttons in the record view.

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

매개 변수

  • 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 transferring from the recordset field to the view, this function turns on the nth radio button (zero-based) and turns off the other buttons. In the reverse direction, this function sets the recordset field to the ordinal number of the radio button that is currently on (checked). On a transfer from the recordset to the control, if the recordset field is Null, no button is selected. On a transfer from control to recordset, if no control is selected, the recordset field is set to Null if the field permits that.

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.

DDX에 대한 자세한 내용은 대화 상자 데이터 교환 및 유효성 검사를 참조하십시오. 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_FieldRadio would be similar.

요구 사항

Header: afxdao.h

참고 항목

참조

DDX_FieldText

DDX_FieldLBString

DDX_FieldLBStringExact

DDX_FieldCBString

DDX_FieldCBStringExact

DDX_FieldCBIndex

DDX_FieldLBIndex

DDX_FieldScroll

개념

MFC 매크로 및 전역