• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

RichEdit: EM_POSFROMCHAR for bottom right corner

I need to know the bottom-right coordinates of a character
in a RichEdit control. Actually I calculate it by performing
the following steps:

    1. get the top-left coordinate by an EM_POSFROMCHAR
    2. calculate the character extent by a
       CDC::GetTextExtent() (called using a temporary
       Device Context)
    3. add the values obtained in steps 1 & 2

the main problem of this solution is in step 2: I need to
select the character for get the relative CHARFORMAT struct,
this cause a flickering problem with the selection.

There's someone that have a better idea?

Thank's in advance.
0
ciutur
Asked:
ciutur
1 Solution
 
Tommy HuiCommented:
Have you tried turning off the redraw flag for the richedit control while you are calculating the text extent?

  SetRedraw(FALSE);
  // do your stuff
  SetRedraw(TRUE);

Then you won't see a flicker for the selection.


0
 
ciuturAuthor Commented:
I gift you my points!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now