Derrick Becker

Hi, I am new to Visual C++ programming and this is my first time posting on this forum. I am hoping someone can help me out.

I recently used and modified a class derived from CStatic so that I could have a CStatic box that gives me the ability to color particular words in the box. In order to do this I had to override the OnPaint since it had to change the text color it was painting for those particular words. I was fighting with this for a while to get scrolling to work and I thought I had everything the way I needed it.

My problem is that I realized that with the way I have it set up the user is not allowed to do text selection on the painted text. With my App the user must have the ability to select the text off of the CStatic window so that it can be pasted in another location. How do I make the text selectable

As I said I am new to Visual C++ programming so don't necessarily assume I have tried anything you may think would be obvious.

Thanks,
Derrick



Re: Visual C++ General Derived CStatic class, Overriden OnPaint() is text selection possible?

Simple Samples

Your question is not a C++ question. The CStatic class is a MFC class and MFC is within the scope of these forums but since you are drawing the text yourself I think it iw best answered in a Windows programming forum or newsgroup.

Have you considered using a CRichEditCtrl






Re: Visual C++ General Derived CStatic class, Overriden OnPaint() is text selection possible?

Derrick Becker

I guess I had assumed that since MFC is typically a pretty integral part of visual c++ that this was relevant to this forum, however as you mentioned I think I will be looking into using a CRichEditCtrl instead. Thanks.