Original Post
I've tried to do this many times, with different approaches, but I usually can't make one that works very well. The selection algorithm is messy, it can only use fixed-length fonts (Courier New), etc. Is there any good tutorial on coding one? I haven't had much luck with Google. I use Visual Basic 6 for basic windows programs that I need done quickly, and Dev-C++ for anything that uses DirectX or any program that I need to run efficiently (Visual C++ takes up alot of RAM, and I generally prefer the Dev-C++ interface and compiler set). The reason I can't just use a default textbox is because I need control over colors (making a combination chat program and IDE) and the reason I can't just use a RTF Textbox is because coloring them generally takes a long, complicated algorithm of string parsing and adding in RTF codes. The best alternative would just be to write my own, custom textbox to fit my needs... but how? Like I said, all my attempts were rather messy. I've come to find that a GDI-drawn Backbuffered, fixed-length font, character-by-character textbox using early ascii characters (like char 1, char 2, etc) for formatting works rather well, but now I have to worry about scrolling and selection and non-fixed-length fonts. Basically all I need is a simple tutorial on coding a simple text entry field complete with selection. Thanks to anyone who has bothered to read all this and respond.