How do I prevent too many labels to be drawn on screen?

Label classes expose the OnScreenPosition property that allow you to know their position on the screen 2D surface. Using this information you can subdivide the screen surface in a grid and prevent multiple labels to be drawn in the same grid cell. The right place to do all of this is the design.Viewports[i].DrawOvelay() method that needs to be overridden. Just before calling the base class implementation you will set the specific label Visible property to true/false.

Was this article helpful?
2 out of 2 found this helpful


1 comment
Date Votes
  • When we set Label.Visible = false, the OnScreenPosition no longer updates.

    Is there a way to force updating the label position seperate from its visibility?


Please sign in to leave a comment.

Articles in this section

See more