private void SaveButton_Click(object sender, EventArgs e) { notesTable.Rows.Add(TitleTextBox.Text, BodyTextBox.Text); TitleTextBox.Clear(); BodyTextBox.Clear(); }
private void ReadSlide(object sender, EventArgs e) { if (NoPowerPoint()) { if (!LoadPresentation()) { return; //If there is no presentation open load one, but return if the user cancels. } } TitleBox.Clear(); BodyTextBox.Clear(); BodyTextBox.ZoomFactor = 1f; //This line is to alleviate a bug in the RichTextBox class that //^prevents display of the proper ZoomFactor after clearing it. foreach (var item in presentation.Slides[1].Shapes) { var shape = (Ppt.Shape)item; if (shape.HasTextFrame != msoTrue) { continue; } if (shape.Name.Contains("Title")) { TitleBox.Text += shape.TextFrame.TextRange.Text + ' '; } else if (shape.TextFrame.HasText == msoTrue) { IDataObject clipped = Clipboard.GetDataObject(); shape.TextFrame.TextRange.Copy(); BodyTextBox.Paste(); //if (BodyTextBox.Font.SizeInPoints > 17f) BodyTextBox.ZoomFactor = 0.5f; if (shape.TextFrame.TextRange.Font.Size > 17f) { BodyTextBox.ZoomFactor = 0.5f; } Clipboard.SetDataObject(clipped, true); } } }
private void NewButton_Click(object sender, EventArgs e) { TitleTextBox.Clear(); BodyTextBox.Clear(); }