質問

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?
役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top