How To… Highlight Clicked Detail Bands


“How can I highlight every clicked detail band in the preview?”


This example shows how to change the color of a shape inside the detail band if the shape is clicked. Begin by assigning the detail band count to the Tag property of each shape drawcommand inside the OnDrawCommandCreate event. Then using a list to keep track of the highlighted detail bands, add or remove enteries each time a shape (detail band) is clicked. Finally regnerate the page updating the color of the shape based on the list values in the DetailBand.BeforePrint event.


Sample Delphi code: