Problem with TfsSyntaxMemo
When I access the fsSyntaxMemo.lines.count the cursor is positioned to the first column and in the first line of the TfsSyntaxMemo.
I do some stuff on keydown or keypress where I need to get the linecount of the TfsSyntaxMemo. If I do so, the cursor jumps to the first line / first column.
I found out that the problem is the LinesChange event. There the fpos is reset, which causes the cursor to jump to the startposition.
I now created a property linecount in a descentend of TfsSyntaxMemo where I set FAllowLinesChange to false, then get lines.count and then set FAllowLinesChange to true again.
This works, but to access FAllowLinesChange, I had to move it from the privat section to the protected in the decleration of TfsSyntaxMemo.
Is there any other way to get linecount without repositioning the cursor? If not, is there a way, that you move FAllowLinesChange to the protected section, because in the other way, I have to do it after every update to a newer version if FS?
Helmut
I do some stuff on keydown or keypress where I need to get the linecount of the TfsSyntaxMemo. If I do so, the cursor jumps to the first line / first column.
I found out that the problem is the LinesChange event. There the fpos is reset, which causes the cursor to jump to the startposition.
I now created a property linecount in a descentend of TfsSyntaxMemo where I set FAllowLinesChange to false, then get lines.count and then set FAllowLinesChange to true again.
This works, but to access FAllowLinesChange, I had to move it from the privat section to the protected in the decleration of TfsSyntaxMemo.
Is there any other way to get linecount without repositioning the cursor? If not, is there a way, that you move FAllowLinesChange to the protected section, because in the other way, I have to do it after every update to a newer version if FS?
Helmut
Comments