Hack Forums
[.NET] Chat bubble - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Chat bubble (/showthread.php?tid=5761342)

Pages: Pages 1 2


Chat bubble - v.e.n.o.m - Dec 1, 2017

Hello HF,
I'am making my own messenger based on xmpp (ejabberd).
Can anyone know how to make chat message bubble like whatsapp or other social messengers.

Maybe i think its gonna done by using UserControl but when i use

UserControl and a Label control in UC. First problem is Label is Uneditable. So, i cant select word to copy. And also Label doesn't have any special feature to show Emoji. And its not auto resize system with message length.

Please if anyone know about this, Pleaseeeee reply me.

Thanks a lot 👍


RE: Chat bubble - EZLib - Dec 1, 2017

You can easily make your own label and make a picture/GFX of a chat bubble.


RE: Chat bubble - v.e.n.o.m - Dec 2, 2017

i don't know much about GDI :(


And how to use emoji picture in Label.


[Image: FhToP.jpg]

like this but want insert Emoji also.


RE: Chat bubble - CoderEX - Dec 2, 2017

It is all going to be done through GDI like Orka said. There is really no other way around it.


RE: Chat bubble - Neos07 - Dec 2, 2017

I think it's doable in WPF.


RE: Chat bubble - v.e.n.o.m - Dec 2, 2017

(Dec 2, 2017 12:32 PM)Orka Wrote:  Fortunately it already exists. https://hackforums.net/showthread.php?tid=3928552 Emojis may be harder, I know richtextbox supports images so you may want to combine them.
Not completely but its help alot..thank you bro. 🤝


But i want insert emoji also.. If you know how to insert emoji in RichTextBox please tell me that method also.


RE: Chat bubble - CoderEX - Dec 2, 2017

(Dec 2, 2017 04:30 PM)v.e.n.o.m Wrote:  

But i want insert emoji also.. If you know how to insert emoji in RichTextBox please tell me that method also.

I found an example, but it is in C#. You can convert it over to VB.NET if you understand both languages.

Otherwise, it might help guide you.

https://stackoverflow.com/questions/16308210/how-to-add-emoticons-to-richtextbox


RE: Chat bubble - v.e.n.o.m - Dec 3, 2017

(Dec 2, 2017 06:00 PM)CoderEX Wrote:  I found an example, but it is in C#. You can convert it over to VB.NET if you understand both languages.

Otherwise, it might help guide you.

https://stackoverflow.com/questions/16308210/how-to-add-emoticons-to-richtextbox

  🤝 Thanks for your valueable post. But didn't work.   😟


RE: Chat bubble - gigajew - Dec 4, 2017

Somebody already made the code for this on stackoverflow, check google.

After some searching: https://stackoverflow.com/questions/24593009/how-to-do-chat-bubbles-in-vb-net-winforms-application


RE: Chat bubble - v.e.n.o.m - Dec 5, 2017

(Dec 4, 2017 08:35 PM)gigajew Wrote:  Somebody already made the code for this on stackoverflow, check google.

After some searching: https://stackoverflow.com/questions/24593009/how-to-do-chat-bubbles-in-vb-net-winforms-application

Yes sir, i was tried that method. But its have few problems. Like auto width, height increament.  Short mesage displayd correctly but when i put a lil'bit long message then bubble cannot show that correctly. 😟


RE: Chat bubble - Ninja - Dec 5, 2017

(Dec 2, 2017 12:32 PM)Effexion Wrote:  Cabin in the Woods was an awful film.

Yes it was, but its one of those "so bad its good" type of films, and I think they aimed for that as well.


RE: Chat bubble - VmX5 - Dec 5, 2017

(Dec 5, 2017 08:55 AM)Ninja Wrote:  Yes it was, but its one of those "so bad its good" type of films, and I think they aimed for that as well.

I agree, I was pretty hyped to watch it for a week and I was disappointed (sorta) after watching it.


RE: Chat bubble - Hawk HF - Dec 5, 2017

The simplest way I can think of is to create your own user control.
Use a graphics path to draw lines and curves until you're satisfied with the shape. That's all a chat bubble is really, curves and lines.
Paint your text and use a bit of math to determine the size that the bubble should be.

Lucky for you I'm bored, and I'm going to give this a shot.

The simplest way I can think of is to create your own user control.
Use a graphics path to draw lines and curves until you're satisfied with the shape. That's all a chat bubble is really, curves and lines.
Paint your text and use a bit of math to determine the size that the bubble should be.

Lucky for you I'm bored, and I'm going to give this a shot.




Update:

[Image: 4bx4VeA.png]

Spoiler (Click to View)

It's in C# but you can easily convert it... I'll leave the dynamic sizing up to you. 🤝


RE: Chat bubble - VmX5 - Dec 5, 2017

I was pretty bored too, heres a control I came up with:

Pastebin (Click to View)

[Image: 80da791c3da18378a7c544b84882dd2f.png]

All it really is, is a rounded rectangle with text.


RE: Chat bubble - v.e.n.o.m - Dec 5, 2017

Woah ! Thats what i said. Its an awesome work VmX5 . But have few issues. I don't know that is my problem or coding. First i see your screenshot. You re-arrange chat bubble in good format. Receiver's message on left side with Control color (not sure) and Sender's message on right size in Dodgerblue color i think. But when i try. See what happens.

[Image: c9xTVtW.png]

BTW, Thank you very much for this awesome work. I really like your work bro.