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. richtextbox

richtextbox

Scheduled Pinned Locked Moved C#
question
6 Posts 6 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.
  • S Offline
    S Offline
    sahelearamesh
    wrote on last edited by
    #1

    hello how can load one file to RichTextBox?

    Q R P L 4 Replies Last reply
    0
    • S sahelearamesh

      hello how can load one file to RichTextBox?

      Q Offline
      Q Offline
      quiteSmart
      wrote on last edited by
      #2

      that would be simple for google. By the way google is smart more than us, you can try asking it from time to time for basic questions like this

      N 1 Reply Last reply
      0
      • Q quiteSmart

        that would be simple for google. By the way google is smart more than us, you can try asking it from time to time for basic questions like this

        N Offline
        N Offline
        netJP12L
        wrote on last edited by
        #3

        richtextbox has a property called Text which you can use to fill richtextbox with the strings. richTextBox rtb = new richTextbox(); rtb.Text="hello";

        1 Reply Last reply
        0
        • S sahelearamesh

          hello how can load one file to RichTextBox?

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          Would you believe, LoadFile()[^]. /ravi

          This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          • S sahelearamesh

            hello how can load one file to RichTextBox?

            P Offline
            P Offline
            Pratik Vasant Shah
            wrote on last edited by
            #5

            Hi, If its just the file you need to open and view the contents into a RichTextBox, you can use the OVERLOADED LoadFile() function which accepts a filename (filepath) as a string and a RichTextBoxStreamType as an another parameter Eg. this.richtextBox.LoadFile("c:\\temp.xxx", RichTextBoxStreamType.RichText). The RichTextBoxStreamType.RichText should be used , if the cile to be opened in the RichtextBox is of RichTextType. Refer MSDN for other flavors of RichTextBoxStreamType ENUM.

            Thanking you in Advance Regards Pratik Shah

            1 Reply Last reply
            0
            • S sahelearamesh

              hello how can load one file to RichTextBox?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              another good guy with goooooogle :) You can load multiple files into RichTextBox one simple way : load the files into separate buffers (dont use RichTextBox.LoadFile or something)... and then set's these buffers with the += .. : System.IO.TextReader tr1 = new System.IO.StreamReader("filename1.txt"); string s1 = tr1.ReadToEnd(); ... richtextBox.Text += s1; and so on :)

              VirtualVoid**.NET**

              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