void Editor_LinesNeedShown(object sender, ScintillaNET.LinesNeedShownEventArgs e) { const uint SCI_SETMARGINTYPEN = 0x08C0; const uint SCI_MARGINSETTEXT = 0x09E2; Editor.Margins.Margin1.Width = 30; Editor.NativeInterface.SendMessageDirect(SCI_SETMARGINTYPEN, 0, 4); for (int i = e.FirstLine - 1; i < e.LastLine - 1; i++) { // Enter custom Scintilla message here for margin number Editor.NativeInterface.SendMessageDirect(SCI_MARGINSETTEXT, i, i.ToString()); } }
/// <summary> /// Raises the <see cref="LinesNeedShown"/> event. /// </summary> /// <param name="e">An <see cref="LinesNeedShownEventArgs"/> that contains the event data.</param> protected virtual void OnLinesNeedShown(LinesNeedShownEventArgs e) { EventHandler<LinesNeedShownEventArgs> handler = Events[_linesNeedShownEventKey] as EventHandler<LinesNeedShownEventArgs>; if (handler != null) handler(this, e); }