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. getting a string from dll & printing it on richtextbox...

getting a string from dll & printing it on richtextbox...

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

    Hi... I want to read a string from a dll & i want to print it in a rich text box on windows form. How can i do this...? How i can define a function which will return a string in dll file so that i can call that function from my form class & get the string to display on form...? Thanks, Vinay

    E 1 Reply Last reply
    0
    • I IamHuM

      Hi... I want to read a string from a dll & i want to print it in a rich text box on windows form. How can i do this...? How i can define a function which will return a string in dll file so that i can call that function from my form class & get the string to display on form...? Thanks, Vinay

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      Erhmpff... this is really back to basic... Create a solution with two projects - Executable project (name : ExeProject) - Class library (name DllClassLibrary) in the class lib. create a class containing the following function : public string MyRichText() { StringBuilder sbMyText = new StringBuilder(); sbMyText.Append("Text text text and even more text"); return sbMyText.ToString(); } Then from your executable project, create a reference to the class lib and add a form containing a textbox. Name the textbox for instance txtTextFromDll In the Load event of your form add the following lines : DllClassLibrary.ClassName objMyClass = new DllClassLibrary.ClassName(); txtTextFromDll.Text = objMyClass .MyRichText(); you're pretty done there (except for when i miss something)

      - - - --[ i love it when a plan comes together ]-- - - -

      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