Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

text Selection in CView

Where can I a find a sample or something on implementing
text selection in a CView (must be CView, text color
inverted from black to white when selected etc...)
0
searching
Asked:
searching
1 Solution
 
zhongbingCommented:
only a skeleton here:
1. message map ON_LBUTTONDOWN
               ON_LBUTTONUP
               ON_MOUSEMOVE
   and add 2 member variable : begin selection flag
                         and   begin selection point

2. in OnLButtonDown
    set the select flag true and begin select point
    SetCapture to track mouse even if it out the current windows
3 in OnMouseMove
    compute the select text, use the begain selecting piont and current mouse point, be cafullly if mouse point outside the window.
     reverse draw the text ( maybe use CClientDC or call invalidate() to let the OnPaint redraw)
4 in OnLButtonUp
     set the selection flag false
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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