GetDocBackgroundColor method

Method
short GetDocBackgroundColor(
VARIANT * pColor,
VARIANT * pChangeable )
Parameters
pColor
Points to a variable to receive the current document background color. This will be one of the color values, such as ARS_OLE_COLOR_WHITE, found in ARSOLEEX.H. On return, this variable is set to type VT_I2.
pChangeable
Points to a variable to receive an indication of whether the document background color can be changed. On return, this variable contains a nonzero value if the color is changeable; otherwise, zero. On return, this variable is set to type VT_I2.
Description
The current document background color and a changeability indicator are returned.
Return Value
Refer to return codes.
See Also
SetDocBackgroundColor method

C/C + +

The following example retrieves the current document background color and disables a menu item if the color cannot be changed.
 CArsOle * pArsCtrl;
 CMenu * pSubMenu;
 short rc, back_color;
 VARIANT current_color, changeable;

   .
   .

 rc = pArsCtrl->GetDocBackgroundColor( &current_color, &changeable );
 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;

 back_color = current_color.iVal;

 pSubMenu->EnableMenuItem(
             ID_VIEW_BKGD_COLOR,
             MF_BYCOMMAND | ( changeable.iVal ? MF_ENABLED : MF_GRAYED ) );
   .
   .

Visual Basic

Dim rc As Integer
Dim back_color, changeable As Variant

 .
 .

rc = ArsOle.GetDocBackgroundColor (back_color, changeable)
If rc <> ARS_OLE_RC_SUCCESS Then
   MsgBox "ERROR"
   End
End If

If changeable <> 0 Then
   menuBackgroundColor.Enabled = True
Else
   menuBackgroundColor.Enabled = False
End If

 .
 .