Last active
November 3, 2021 14:27
-
-
Save bjoerntx/04eb8668c223edbac9c156c46e3aa8d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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