Posted 19 years ago
by Tim Strong

I have checked all your forums and documentation on CustomLineNumbering and am still not getting the issue below resolved. I have tried coding inside events _KeyTyped, KeyTyping, KeyPress, KeyDown, and even overriding ProcessCmdKey(...), but with no success, so I need help and quickly.
I have a custom code editor with Custom Line Numbering which when I hit the "\r" or Key.Enter should increment the next line by the factor set.
For instance:
10
20
30
:
:
However, when I try to recompute what the CustomLineNumbering value should be and try to reset it for that line, the default values of auto line numbering take over (i.e. 10,11,12,13...)... I want to displace these auto-line numbers with my own.
Is there some code you would recommend to implement this?
What I have so far is something like (c#.net):
int iCurrentLinePosition = CodeEditor.Caret.Position.Line;
DocumentLine dLine = CodeEditor.Document.Lines[iCurrentLinePosition];
int iOldLineNumberFromCaretPosition = Convert.ToInt32(dLine.CustomLineNumber);
int iNewLineNo = iOldLineNumberFromCaretPosition + (int)this.AutoLineNumberingIncAmount;
dLine = CodeEditor.Document.Lines[iCurrentLinePosition + 1];
dLine.CustomLineNumber = iNewLineNo.ToString();
However, when I try to implement in any of the Key* events, my calculated Custom Numbering is still overridden by your auto-line numbering incremented by 1's...
Any suggestions would be appreciated ASAP.
Thanks,
Tim
I have a custom code editor with Custom Line Numbering which when I hit the "\r" or Key.Enter should increment the next line by the factor set.
For instance:
10
20
30
:
:
However, when I try to recompute what the CustomLineNumbering value should be and try to reset it for that line, the default values of auto line numbering take over (i.e. 10,11,12,13...)... I want to displace these auto-line numbers with my own.
Is there some code you would recommend to implement this?
What I have so far is something like (c#.net):
int iCurrentLinePosition = CodeEditor.Caret.Position.Line;
DocumentLine dLine = CodeEditor.Document.Lines[iCurrentLinePosition];
int iOldLineNumberFromCaretPosition = Convert.ToInt32(dLine.CustomLineNumber);
int iNewLineNo = iOldLineNumberFromCaretPosition + (int)this.AutoLineNumberingIncAmount;
dLine = CodeEditor.Document.Lines[iCurrentLinePosition + 1];
dLine.CustomLineNumber = iNewLineNo.ToString();
However, when I try to implement in any of the Key* events, my calculated Custom Numbering is still overridden by your auto-line numbering incremented by 1's...
Any suggestions would be appreciated ASAP.
Thanks,
Tim