Question

I have a class that implements OnDraw to draw text and images to a CView. At certain times (ie onClick) I would like this text to be editable in place. What would be the best way to implement this?

  • Have the class have a CEdit object that I hide and show and draw over the top of my text.
  • Handle key presses in the class and implement my own editing
  • Have something external to the class control whether to show the edit box or my class
  • Something else?
Was it helpful?

Solution

Go with your first idea, create a CEdit box when you need some text editing. If you look at how a ListCtrl handles rename functionality it does exactly that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top