private void Delete_Click() { if (WikiPageCur == null) { return; } if (WikiPageCur.PageTitle == "Home") { MsgBox.Show(this, "Cannot delete homepage."); return; } if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete this wiki page? It will still be available from the Search window if needed.")) { return; } WikiPages.Delete(WikiPageCur.PageTitle); //historyNavBack--;//do not decrement, load will consider this a branch and put "wiki:Home" in place of the deleted page and remove "forward" history. LoadWikiPage("Home"); }