Results 1 to 5 of 5

Thread: Load VS.NET class files in RTB pertaining syntax color?

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Load VS.NET class files in RTB pertaining syntax color?

    I tried this but it throw an error saying : "Invalid file format" .
    VB Code:
    1. Me.RichTextBox1.LoadFile("c:\a.cs", RichTextBoxStreamType.RichText)


    but

    when I try this , it works WITHOUT keywords color

    VB Code:
    1. Me.RichTextBox1.LoadFile("c:\a.cs", RichTextBoxStreamType.PlainText)

    I need to load the file in RTB pertaining syntax coloring .

    Anybody knows why it making that error ??

    Thanks

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The data in the file is not Rich Text its just plain text hence the error. The IDE itself is doing the coloring, its not in the file itself. Rich Text is like a language all its own. You can find specs for the Rich Text format on the web here is one: http://www.microsoft.com/downloads/d...displaylang=en

  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You mean , I should handle keywords coloring after loading the file as plain text format?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes because the file doesn't have any information about coloring in it. You can open it in Notepad to see what it has and it'll be just the plain text. If you want to see what rtf looks like then save a word document as RTF then open it in Notepad. You'll see a bunch of stuff mixed in with the text.

  5. #5

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Thanks Edneeis . I'll spend some time reading some stuff in that document .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width