I know that you are talking about like how it is done in Notepad++, and this isn't exactly that, but I don't know of a different way.
http://blogs.msdn.com/saraford/archi...05/257953.aspx