In my application, I have a rich text box that should only contain text (in rich text format with all those tabs and styles) but not images and other things. The only way things can be 'inserted' into this box is by pasting. So here's the sub that handles this:However, I get an error in both instances of DataFormats.Rtf (underlined above) that says:VB Code:
Private Sub mnuSnippetBoxPaste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSnippetBoxPaste.Click If SnippetBox.CanPaste([u]DataFormats.Rtf[/u]) Then SnippetBox.Paste([u]DataFormats.Rtf[/u]) End If End Sub
Value of type 'String' cannot be converted to 'System.Windows.Forms.DataFormats.Format'.
Hope someone can tell me what I am doing wrong.




Reply With Quote