Results 1 to 19 of 19

Thread: [RESOLVED] Help me speed this up...

Threaded View

  1. #1

    Thread Starter
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Resolved [RESOLVED] Help me speed this up...

    Hi there,

    I'm making a simple Code Library, and though someone on this forum in VB6 land made one that looks sharp, I thought this would be a fun project, and one I could tailor to fit my needs. One of the things I wanted to do was syntax hilighting on the displayed files.

    Here is my method as of now, which does work well, but is a bit slow when reading large files.

    The lowdown - I have two files, (Which I'll attatch with in the zip, and will have to be pointed at by the program should you decide to run it and help me ) - The form load event tells the program where they are. They are read into two ArrayLists, and then, upon choosing "New" from the file menu, a chosen C# or VB.NET file is loaded into the RichTextBox, and then it's parsed by the Hilight method using RichTextBox.Find(). Like I said, It does work, but if I load a larger file, it takes a few seconds to parse, and this would be annoying given the ultimate layout of the program (i.e, the typical "Code Library" you've seen in the past - Treeview on left with snippets, click puts them into RichTextBox)

    Can anyone point me in the right direction, or just give me general advice on how to speed this program up a bit? Originally, I was splitting the lines as read in and manipulating the colors with the RichTextBox, but I was having some trouble putting them back together, and missing some of the hilighting (i.e, when I had things close together, it wouldn't split them right [int i=new int; for example - didn't split because i=new looked like one word]

    This method seems to work without changing any of the coding, but it is a bit slow. Again, I'd much rather have general advice or psuedocode, as this is mostly an exercise in learning c#...

    Bill
    Attached Files Attached Files
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

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