TextEditor SetLineHidden and SetLineReadonly Inquiries

Hi,

I just want to ask the following

  1. Is there a way to show the line(s) in TextEditor as literally read-only lines when using SetLineReadonly? Ex., making the lines greyed-out/disabled.

  2. If I use the SetLineHidden, can I reset the line numbers of visible lines to 0?

Thanks,
Jena

Hi Jena,

You can use the ReadonlyBackColor property of TextEditor control to change the appearance of read-only lines; please refer to the screenshot below:

With SetLineHidden, could you please explain it in more detail? Do you have hidden lines at the beginning of the text, and the first visible line shows a different value to 1?

TextEditor has the property LineNumbersStart, which you can configure to start numbers from a different value. However, it does not accept zero or negative numbers (which can be easily fixed).

Kind regards,
Dmitry

Hi Dmitry,

Thank you for your response. Your answer in number 1 works and exactly what I needed. Thanks for that.

For my second inquiry. I think the LineNumbersSart doesn’t work if some of my lines are hidden. Kindly see screenshot

image

There are before and after lines hidden and only this Hello method is visible. As I can see, it shows the original line number, hence it started with line 8. The lines 1-7 are some of the lines I hid.

Kindly advise.

Thanks,
Jena

Hi Jena,

We will release a small update via NuGet shortly, which will allow setting LineNumbersSart to the negative number - this way it should work in case you have a few hidden line numbers at the beginning of the text.
We will also add a property that will take into account hidden lines when displaying line numbers even if these hidden lines are somewhere in the middle of the text - this one will be included in the next regular update.

Kind regards,
Dmitry

Hi Jena,

We’ve just released a small update to NuGet (version 9.1.3) where the issue with setting LineNumbersSart to the negative values should be fixed; it should allow adjusting line numbers to be displayed from 1 in case there are hidden lines at the beginning of the text.

Kind regards,
Dmitry

Thanks Dmitry! Will check the new updates for this. Again, thank you for the support.

1 Like