Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active November 3, 2021 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/04eb8668c223edbac9c156c46e3aa8d6 to your computer and use it in GitHub Desktop.
Save bjoerntx/04eb8668c223edbac9c156c46e3aa8d6 to your computer and use it in GitHub Desktop.
// global flag that indicates whether the next inserted list item
// should be continued
private bool restartFlag = false;
// restarts the numbering
private void button1_Click(object sender, EventArgs e)
{
textControl1.Selection.ListFormat.RestartNumbering = true;
restartFlag = true;
}
// continues the following paragraph (item), if the global flag is true
private void textControl1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode != Keys.Return || restartFlag == false) return;
if (textControl1.Selection.ListFormat.Type == TXTextControl.ListType.Numbered)
{
textControl1.Selection.ListFormat.RestartNumbering = false;
restartFlag = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment