BackgroundFill Property (ActiveX)

Specifies whether multiline text has a background fill.

Supported platforms: Windows only

Signature

VBA:

object.BackgroundFill
object

Type: GeoPositionMarker, MText

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

MText: The value contained in this property is the Background Mask property in the Properties palette.

Examples

VBA:

Sub Example_BackgroundFill()
    ' This example creates a circle and an MText object, and masks part of the 
    ' circle with the MText object

    'Draw a circle
    Dim circleObj As AcadCircle
    Dim CircleReference(0 To 2) As Double
    Dim radius As Double
    CircleReference(0) = 0
    CircleReference(1) = 0
    CircleReference(2) = 0
    radius = 5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(CircleReference, radius)
    ZoomAll
    MsgBox "A circle has been drawn."
    
    'Create an MText object with the BackgroundFill property set to True
    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    width = 10
    text = "This is the text for the MText object"
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(CircleReference, width, text)
    MTextObj.BackgroundFill = True
    ZoomAll
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_BackgroundFill()
    ;; This example creates a circle and an MText object, and masks part of the 
    ;; circle with the MText object
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Draw a circle
    (setq CircleReference (vlax-3d-point 0 0 0)
          radius 0.5)
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq circleObj (vla-AddCircle modelSpace CircleReference radius))
    (vla-ZoomAll acadObj)
    (alert "A circle has been drawn.")
    
    ;; Create an MText object with the BackgroundFill property set to True
    (setq width 5
          text "This is the text for the MText object")
    (setq MTextObj (vla-AddMText modelSpace CircleReference width text))
    (vla-put-AttachmentPoint MTextObj 5)
    (vla-put-InsertionPoint MTextObj CircleReference)
    (vla-put-BackgroundFill MTextObj :vlax-true)
    (vla-ZoomAll acadObj)
)