cancel
Showing results for 
Search instead for 
Did you mean: 

Diagram APIs - DrwText BackgroundColorSet

SOLVED
Highlighted
Contributor

Diagram APIs - DrwText BackgroundColorSet

Hello,

 

I need to colorize simple text fields with a specific background color (MEGA 2009 SP2 CP3).

 

The BackgroundColorSet function seems to work only on fields that already have a background color.

If text field has no background color defined, then the function will have no effect.

 

Is there a way to define the background color of a field that does not have any yet?

 

Thanks in advance!

 

Sergueï

 

Set oDiagram = oRoot.GetObjectFromId("~Aw4yS7lsFP50[Diagramme de zones d'urbanisme]")
Set oDrawing = oDiagram.Drawing("RW")

For Each oDI In oDrawing.DrawingItems
  If oDI.DrawClassName = "DrwText" Then
    Set oFont = oDI.Font
    oFont.BackgroundColorSet 0, 255, 0, 0
    oDI.Font = oFont
  End If
Next

oDrawing.Flush

Set oDrawing = Nothing
Set oDiagram = Nothing

 

 

1 REPLY
MEGA

Re: Diagram APIs - DrwText BackgroundColorSet

Hello Sergueï

 

I can confirm a MEGA error.This issue has been escaladed to MEGA R&D (CR 31169).
A fix is available with HOPEX V1R1 adn higher versions.

Jerome