Link to home
Start Free TrialLog in
Avatar of carl404
carl404

asked on

Line Numbers in RichEdit

Hi!
I have two simply questions ;)

1. How to add a column with line numbers on the left side of richedit ?
2. Some applications are using a kind of property sheet to gather all text editor windows and comfortably switch between them. This is a MSVS .net fashion property sheet for text windows. How to do it ?

Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Part 1)
You will have to add the line numbers yourself to each line of text as the user enters it (or as it is loaded from file).
Try this

PARAFORMAT2 pf2;
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_NUMBERING | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE;
pf2.wNumbering = 3;
pf2.wNumberingStart = 1;
pf2.wNumberingStyle = 2;
::SendMessage(RE30->Handle, EM_SETPARAFORMAT, 0, (LPARAM) &pf2);

Good Luck
Avatar of carl404
carl404

ASKER

hmm... This is not what I am looking for. I want something more like http://www.pnotepad.org/ line number indicator.
Thanks anyway :)
If it is just display (not user entry) then you could code your own view based on a CScrollView.  That gives you complete control over how it is displayed
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial