# TextEditor SetLineHidden and SetLineReadonly Inquiries

**URL:** <https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432>\
**Category:** AlterNET Studio Support\
**Tags:** wpf, editor\
**Created:** [November 17, 2023, 12:21am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432 "2023-11-17T00:21:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenado](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/j/606060/32.png) [@jenado](https://forum.alternetsoft.com/u/jenado)\
**Post date:** [November 17, 2023, 12:21am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/1 "2023-11-17T00:21:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [November 18, 2023, 12:08pm UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/2 "2023-11-18T12:08:46Z")

</div>

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:

 ![image](https://forum.alternetsoft.com/uploads/default/original/1X/da3420d03366187817c8234cf93679b2cb10f2bf.png)

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

---

<div class="post-metadata">

**Author:** ![jenado](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/j/606060/32.png) [@jenado](https://forum.alternetsoft.com/u/jenado)\
**Post date:** [November 22, 2023, 12:35am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/3 "2023-11-22T00:35:26Z")

</div>

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](https://forum.alternetsoft.com/uploads/default/original/1X/890b783fae550d4fd523242db48a7b97afc44026.png)

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

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [November 22, 2023, 6:27am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/4 "2023-11-22T06:27:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)\
**Post date:** [November 28, 2023, 6:27am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/5 "2023-11-28T06:27:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jenado](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/j/606060/32.png) [@jenado](https://forum.alternetsoft.com/u/jenado)\
**Post date:** [November 29, 2023, 1:45am UTC](https://forum.alternetsoft.com/t/texteditor-setlinehidden-and-setlinereadonly-inquiries/432/6 "2023-11-29T01:45:59Z")

</div>

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