Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic backcolor of shape
Message
 
To
26/05/2008 10:40:50
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01319505
Message ID:
01319629
Views:
16
My guess is that that BACKCOLOR directive you have created uses code that is run in the EvaluateContents method to change the backcolor of text. However, EvaluateContents is NOT fired for shapes .. only expression fields. Therefore, the BACKCOLOR directive will not work on shapes.

To dynamically change the color of the shapes you can upgrade to SP2 and take advantage of the feature built in to the product. Otherwise, you will have to create a different directive that uses GDI+ to draw the shapes in whatever color you want instead of letting the VFP Report Writer draw the shape in the defined color.

Cathy Pountney




>Hello everybody
>In my report i manipulate the backcolor of all textboxes in a row with the following in the user field.(prg_render is a example found somewhere in the net)
>*:LISTENER||BACKCOLOR|| ICASE(listwahl.feiertag1 <> ' ',255,
>SUBSTR(listwahl.tag1,4,2) = 'So',12632256,
>SUBSTR(listwahl.tag1,4,2) = 'Sa',12632256,16777215)
>
>I call my report with:
>loListener = newobject('MyReportListener_Directives','prg_render.prg')
>loListener.AllowModalMessages = .t.
>loListener.DynamicLineHeight = .t.
>loListener.ListenerType = 1
>report form b_myreport.frx TO PRINTER PROMPT preview object loListener
>
>Holidays get red backcolor,weekend grey backcolor
>Everything works as expected.
>
>Now i tried to put a shape around my detail record and manipulate the backcolor of this shape, not the backcolor of every textbox.
>But the shape never changes its backcolor.
>I has nothing to do with the icase...
>*:LISTENER||BACKCOLOR||12632256 should change every shape to backcolor grey, but no success
>Is there a difference between handling textboxes and shapes ??
>What do i miss?
>Any help welcomed
>Best regards
>Albert
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform