Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. RichTextBoxStreamType.PlainText Does not work.

RichTextBoxStreamType.PlainText Does not work.

Scheduled Pinned Locked Moved C#
helpquestiondiscussion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Baeltazor
    wrote on last edited by
    #1

    Hi All. In my rich text editor everything's finished except for one thing. I want the user to be able to save the file as EITHER RTF or TXT. But when I use this:

    Rtb.SaveFile(Sf.FileName, RichTextBoxStreamType.PlainText);

    ... It never works. The next time they open the TXT file it opens but with all the RTF formatting codes in it which makes the file ugly and unreadable and unacceptable. Does anybody know how I can fix this, or know of any other ways to do this. I have tried doing this also, but doesn't always work:

    string text = Rtb.Text;
    File.WriteAllText(Sf.FileName, text);

    I have been to MSDN and Google and there's a whole lot of junk on Google with no solutions. (Btw, I'm beginning to favor Microsoft's new search: Bing over Google nowadays). I'm completely baffled as to why the PlainText option does not work. Any thoughts? Anyone? regards, jase

    B 1 Reply Last reply
    0
    • B Baeltazor

      Hi All. In my rich text editor everything's finished except for one thing. I want the user to be able to save the file as EITHER RTF or TXT. But when I use this:

      Rtb.SaveFile(Sf.FileName, RichTextBoxStreamType.PlainText);

      ... It never works. The next time they open the TXT file it opens but with all the RTF formatting codes in it which makes the file ugly and unreadable and unacceptable. Does anybody know how I can fix this, or know of any other ways to do this. I have tried doing this also, but doesn't always work:

      string text = Rtb.Text;
      File.WriteAllText(Sf.FileName, text);

      I have been to MSDN and Google and there's a whole lot of junk on Google with no solutions. (Btw, I'm beginning to favor Microsoft's new search: Bing over Google nowadays). I'm completely baffled as to why the PlainText option does not work. Any thoughts? Anyone? regards, jase

      B Offline
      B Offline
      Baeltazor
      wrote on last edited by
      #2

      Never mind, :) I'm going to begin looking into making my own input control. Wish me luck! :D

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups