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. retrieving text from richtextbox [modified]

retrieving text from richtextbox [modified]

Scheduled Pinned Locked Moved C#
helpgraphicstutorialquestion
1 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.
  • D Offline
    D Offline
    DKalepu
    wrote on last edited by
    #1

    Hi All, I have a RichTextBox and two buttons placed on the windows form. Where user can type the text he wants, and inserts any picture by clicking "insert picture" button. Whenever he clicks the "EXPORT" button, i want to retrieve all the text from the Richtext box to a string variable. Now, my problem is that, i can save the text but if there is any picture inserted in the message, it is indicating as "space" in the text. I want to insert a special character ( like any character between 127 - 255 in ascii table) in the place of that picture. How could I do that? could any one please guide me.. I'm really lost in this issue since 3 days! :(( Here i'm posting my code here!: pic = ImageSelect.pbSelected[i].Image; InsertImage(pic); private void InsertImage(Image pic) { Bitmap myBitMap = new Bitmap(pic); Clipboard.SetDataObject(myBitMap); DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.Bitmap); maskedTextBox1.Paste(); if (richTextBox1.CanPaste(myFormat)) { richTextBox1.Paste(myFormat); } else MessageBox.Show("cannot paste"); } private void btnExport_Click_1(object sender, EventArgs e) { //richTextBox1.SaveFile("D:\\b.txt"); strMessage = richTextBox1.Text; MessageBox.Show(strMessage); } Thanks, Durga.

    Strength is life, Weakness is death. --- Swami vivekananda

    modified on Wednesday, February 20, 2008 1:57 AM

    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