How do I show line numbers?

The answer lies in the Margins. By default Margin 0 dispalys line numbers, but also by default it has a width of 0, effectively hiding it. Set margin 0's width to something like 20 to make it show up.

From Code:
scintilla.Margins[0].Width = 20;

Or in the designer expand Margins, then Margin0. Set the Width to 20.

Last edited Oct 16, 2009 at 8:43 PM by ChrisRickard, version 2


davidmiddle Jan 19, 2012 at 3:24 PM 
Is there a way to suspend line numbers for some lines and restart at a later line. I am wanting to do this so I can sync up line numbers between two editors

PuterdoBorato Sep 23, 2010 at 4:58 PM 
Is there way to adjust Margin0 Width automatically? For a long text the line number could be big enough and i don't want to guess how big it is.