locked
Adding lengthy text to Textbox or label RRS feed

  • Question

  • I'm trying to include some pretty long worded documentation into my app and it appears theres a character limitation.  Not only that I need to add tabbed headings and paragraph breaks.  It seems like this wont work for labels or textboxes so I have added a webbrowser control to display this information.

    Does this seem like a logical move.  I don't like the idea of having to reference a url.

     

    Monday, May 17, 2010 4:28 PM

Answers

  • Hi Rjl66,

    If the htm file has been deployed to the application folder, the code should be like this:

        string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
        string filePath = Path.Combine(appPath, "myfile.htm");
        webBrowser1.Url = new Uri(Path.Combine("file://", filePath));

     

    Just set its "Copy to Output Directory" property to "Copy if newer".

     

    If you still have question, please let me know.
     

    Best regards,
    Guang-Ming Bian - MSFT

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Rjl66 Thursday, May 20, 2010 12:29 PM
    Thursday, May 20, 2010 7:00 AM

All replies

  • The WebBrowser is probably the easiest way.  DOing it otehrwise requires that you do an owner-drawn control and you have to control what text is shown, wrapping, and all of the other "goo" required to get it to display and scroll.
    Monday, May 17, 2010 10:15 PM
  • I'm trying to disaplay a htm file located on the device but having a ____ of a time getting the url line to accept it.

    What's the trick to doing this?

    webbrowser1.url="myfile.htm"   Doesnt work

     

    Thanks

     

     

     

    Tuesday, May 18, 2010 11:56 AM
  • Hi Rjl66,

    If the htm file has been deployed to the application folder, the code should be like this:

        string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
        string filePath = Path.Combine(appPath, "myfile.htm");
        webBrowser1.Url = new Uri(Path.Combine("file://", filePath));

     

    Just set its "Copy to Output Directory" property to "Copy if newer".

     

    If you still have question, please let me know.
     

    Best regards,
    Guang-Ming Bian - MSFT

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Rjl66 Thursday, May 20, 2010 12:29 PM
    Thursday, May 20, 2010 7:00 AM