Implement Chat Window via WinForms ?

  • Thread starter Jackson Houndmugger
  • Start date
J

Jackson Houndmugger

Hi,

The WinForms application that I'm designing must support online chat.
I'm wondering what class to use to display the chat messages. The obvious
choice would be a multi-line TextBox control which I could continue to
append each time a new chat message needs to be displayed. The problem is
that there are a certain class of chat messages known as "system messages"
that must be shown in red and as far as I can tell, the TextBox control
doesn't support setting specific colors for small selections of text.

Any ideas? I don't mind paying for a 3rd party component if there is not
a suitable class in the framework. I don't need to support any fancy
features such as emoticons -- just colored text.

Thanks,

Jackson
 
G

Guest

Jackson, there might only be a small handful of us developers, but if ever
there was a NEEDED feature....you just nailed it!

Every workaround has its pros and cons:

1. You can try using richtextboxes. Heaven help you survive coding RTF.

2. You can bite the bullet and go the HTML route. Sounds promising until
you start messing with various glitchy techniques to proper seat a
webbroswer container.

3. You can get real creative and build a usercontrol to manage an array of
labels (or textboxes) that you can resize, re-sequence, and color at your
leisure. Cut my wrist on that one!

4. Or just maybe you got the guts to try using GDI+ on a usercontrol. When
you get lost in that maze, you deserve it!

::chuckles:: I realize I'm not helping, but I, too, wish Microsoft would
show some compassion and give us a textbox that handles 100% alphablending
and color mix-matching WITHOUT the evil RTF laughing in our faces.

Nuff said?!!

Lacy
 
J

Jackson Houndmugger

::chuckles:: I realize I'm not helping, but I, too, wish Microsoft would
show some compassion and give us a textbox that handles 100% alphablending
and color mix-matching WITHOUT the evil RTF laughing in our faces.

Wow, each of the ideas that you've presented are so painful ! :( I was
hoping for a much easier answer. Hopefully someone out there has built a 3rd
party control for this. I start looking.

Thanks for the response,

Jackson
 
J

Jackson Houndmugger

Wow, each of the ideas that you've presented are so painful ! :( I was
hoping for a much easier answer. Hopefully someone out there has built a 3rd
party control for this. I start looking.

I didn't have any luck finding a suitable 3rd party component. I'm kind
of surprised. One possible hack might be to use a read-only grid control and
add a new row for each chat message. It's ugly but I can't think of a better
solution.

Jackson
 
J

Jackson Houndmugger

Jackson, there might only be a small handful of us developers, but if ever
there was a NEEDED feature....you just nailed it!

Every workaround has its pros and cons:

1. You can try using richtextboxes. Heaven help you survive coding RTF.

This is the approach that I ended up taking. In my case, the only "rich"
feature that I was interested in was changing the colors for certain types
of messages which appear in the chat window. The RichTextBox does this quite
nicely and there's no need to code raw RTF.

One thing that most chat boxes have in common is that you'll want them
to scroll to the bottom when a new chat message is received. There is a bug
in the .NET wrapper for the RTF control that prevents this from happening
when the RTF control doesn't have focus. The following hack must be applied
in order to force the RTF to scroll properly:

http://www.syncfusion.com/faq/winforms/search/890.asp

Jackson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top