Solved

CRichEditCtrl with grid

Posted on 2000-03-07
5
395 Views
Last Modified: 2013-11-20
My user requested me to draw grid on the CRichEditCtrl control and any typed character will be display within the grid, would it possible? How to do that?

Thanks.
0
Comment
Question by:limbe
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:gelbert
ID: 2592541
If you are really have to draw grid on CRichEdit (can you just use grid and insert CRichEdit ctrls into cells?) then you would need to derive from CRichEditView and overwrite OnDraw() to
paint lines and paint cursor in correct cell.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 2592559
0
 

Author Comment

by:limbe
ID: 2594951
My CRichRditCtrl is one of the object in a form- based window, and I 've to limit the text length according to the user define size, users are allow t o change the size at run time, thus, my CRichEditCtrl has both horizontal and vertical scroll bar and auto text-formatting. Now, my user  request to has grid on the CRichEditCtrl editing area. Sounds like possible if CRichEditView, but how about CRichEditCtrl?

Thanks.
0
 

Author Comment

by:limbe
ID: 2594959
Further explanation, I meant "user defined size" is  in term of characters. Users are allow to specify how many rows and how many characters per row . Thanks.
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2600869
So bacisly you will have to overwrite OnPaint() of you CRichEditCtrl.

But I would suggest to modify sample which I pointed which does almost what you need it derives MFC Grid control from CWnd (in you case it would be CRichEditCtrl).
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question