CRichEditCtrl with grid

Posted on 2000-03-07
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?

Question by:limbe
  • 3
  • 2

Expert Comment

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.

Accepted Solution

gelbert earned 100 total points
ID: 2592559

Author Comment

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?


Author Comment

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.

Expert Comment

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).

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 196
Excel Use VBA to get user's Mac Address for their computer 5 248
Change to event 1 119
Problem to App source 6 72
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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