private void btnBookmarkPrevious_Click(object sender, EventArgs e) { SyntaxBoxControl syn = synCode; if (syn != null) { int curr = syn.Caret.CurrentRow.Index; int nextln = syn.Document.GetPreviousBookmark(curr); if (nextln < curr) { // next in page... syn.GotoPreviousBookmark(); } else { int tab = tabDocs.SelectedIndex; // previous tab??? for (int i = tab - 1; i >= 0; i--) { syn = tabDocs.TabPages[i].Controls[0] as SyntaxBoxControl; nextln = syn.Document.GetPreviousBookmark(0); if (nextln > -1) { tabDocs.SelectedIndex = i; syn.GotoLine(nextln); return; } } // finish wrap for (int i = tabDocs.TabPages.Count - 1; i >= tab; i--) { syn = tabDocs.TabPages[i].Controls[0] as SyntaxBoxControl; nextln = syn.Document.GetPreviousBookmark(0); if (nextln > -1) { tabDocs.SelectedIndex = i; syn.GotoLine(nextln); return; } } } } }