private void NumLineas_Paint(object sender, PaintEventArgs e) { int Altura = TxtCodigo.GetPositionFromCharIndex(0).Y; if (TxtCodigo.Lines.Length > 0) { for (int i = 0; i <= TxtCodigo.Lines.Length - 1; i++) { int aux = i + 1; e.Graphics.DrawString(aux.ToString(), TxtCodigo.Font, Brushes.DimGray, numLineas.Width - (e.Graphics.MeasureString(aux.ToString(), TxtCodigo.Font).Width + 10), Altura); Altura += 15; } } else { e.Graphics.DrawString("1", TxtCodigo.Font, Brushes.DimGray, numLineas.Width - (e.Graphics.MeasureString("1", TxtCodigo.Font).Width + 10), Altura); } }