Width of string to the right of a point, in a bi-directional text
问题 *Sorry if the title is not great. I am not sure how to summarize this question into a few words. I have a DataGridView and a search box. When the user types a query, any matching result in the DataGridView cells, is highlighted. To achieve this I use the CellPainting event of DataGridView and draw a rectangle behind the results. Some of the cells are oriented Right-To-Left: And some are oriented Left-To-Right: When the orientation is RTL, I use the following formula to calculate the highlight