Wiki Home

Get Dbcx Caps


Namespace: VB
Here is a VFE label builder enhancement that will act on multiple labels and checkboxes and set the caption to the caption prop in dbcx.

This replaces the code in the click of "Reterive caption from DBCX" button.

LOCAL ;
  lnCtls, laCtls[1], loCtl

LOCAL ;
  lnBindType, ;
  lcDataSource, ;
  lcObjectName, ;
  lcCaption

lnCtls = ASELOBJ( laCtls )
IF lnCtls > 0
  FOR EACH loCtl IN laCtls
    IF INLIST( loCtl.BASECLASS,  "Label", "Checkbox" )


      * WITH This.Parent.Parent.fpgPage1
      WITH loCtl
        *	lnBindType = .opgBindControl.Value
        lnBindType = 1
        *	lcDataSource = IIF(lnBindType = 1 OR lnBindType = 2, .cboField.Value, .cboParameter.Value)
        lcDataSource = .cField
      ENDWITH

      lcObjectName = THISFORM.GetObjectName(THISFORM.oObject, lcDataSource)

      IF NOT EMPTY(lcObjectName)

        IF lnBindType = 1 OR lnBindType = 2		&& Field
          lcCaption = oVFE.oMetaMgr.DBCXGetProp(lcObjectName, "Field", "VFEcFrmCaptn")
        ELSE										&& View Parameter
          lcCaption = oVFE.oMetaMgr.DBCXGetProp(lcObjectName, "Parameter", "VFEcFrmCaptn")
        ENDIF


        IF NOT ISNULL(lcCaption) AND NOT EMPTY(lcCaption)
          *		This.Parent.txtCaption.Value = lcCaption
          loCtl.CAPTION = lcCaption
          *		This.Parent.txtCaption.InteractiveChange()
          *		loCtl.InteractiveChange()
        ENDIF

      ENDIF

    ENDIF
  ENDFOR
ENDIF
RETURN

contributors Carl Karsten
Category DBCX Category Code Samples Category Visual FoxExpress Tips And Tricks
( Topic last updated: 2000.01.26 09:52:05 PM )