The mysterious ways of the RichTextBox...
The kind of systems and applications I normally develop are browser-based, but now and then I try my luck at Windows Forms. Right now I'm doing this little instant messaging program, a pretty simple chat that communicates with a server via SOAP. Anyways, I'm having this battle with a RichTextBox I'm using in a form to display chat messages, smilies and such. Explain this to me: When the RichTextBox is designed to be anchored to the bottom of the form, whenr I add text to it while it's minimized in the task-bar, it refuse to scroll down to the end/bottom of the RichTextBox. The effect is that when I bring up the form from the task-bar and look at it, no messages are displayed until I tap once on the vertical scrollbar! Very amazing and feels like a bug. It doesn't matter how much I try to use the ScrollToCaret() method or other tricks, if the RichTextBox has the anchor property set to bottom, ScrollToCaret() doesn't work as it should.
I think I'll have to subclass the RichTextBox and send my own scroll-messages to it to make this work. :(