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