private bool GetPrintText(int DocumentID) { try { rtbPrintContent = new RichTextBoxEx() { Rtf = SermonReader.DisplayStoredSermon(Sermon.GetSermonComponents(DocumentID)).RTFpublic }; return(true); } catch { return(false); } }
private void MenuItemPrintAll_Click(object sender, EventArgs e) { DialogResult userChoice = MessageBox.Show("If many files are to be printed, your PC will be taxed. Do you wish to continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (userChoice == DialogResult.Yes) { try { RichTextBoxEx rtbSource = new RichTextBoxEx(); foreach (TreeNode tnParentNode in Nodes) { foreach (TreeNode tnChildNode in tnParentNode.Nodes) { try { string rtf = SermonReader.DisplayStoredSermon(Sermon.GetSermonComponents(int.Parse(tnChildNode.Name))).RTFpublic; try { if (rtbSource.Rtf.ToLower().Contains("rtf")) { rtf = AppendRTF(rtbSource.Rtf, rtf); } } catch { } rtbSource.Rtf = rtf; rtbSource.Text += PAGE_BREAK; } catch { MessageBox.Show("An error was encountered in opening [" + tnChildNode.Text + "]."); } } } MyPrintDialog myPrintDialog = new MyPrintDialog(parentForm, rtbSource); } catch {; } } }
/* private void lvShowFoundItems_SelectedIndexChanged (<object>, <EventArgs>) * This function is called when the user clicks on a list view item * * */ private void lvShowFoundItems_SelectedIndexChanged(object sender, EventArgs e) { parentForm.AddNewTabPage(SermonReader.DisplayStoredSermon(Sermon.GetSermonComponents(int.Parse(lvShowFoundItems.FocusedItem.Name)))); Close(); }
public void DisplayTreeNodeItem(TreeNode treeNodeSelected) { Form sermonReader = SermonReader.DisplayStoredSermon(Sermon.GetSermonComponents(int.Parse(treeNodeSelected.Name))); parentForm.AddNewTabPage(sermonReader); }