|
-
Dec 29th, 2006, 01:00 PM
#1
Thread Starter
Frenzied Member
[2.0] Sockets question
Hey guys, before my chat application went on the web, I used this to transfer my bolded, colored, styled font to the message log:
Code:
txtMessages.AppendText(userName);
txtMessages.SelectedRtf = txtYourMessage.Rtf;
However, now, since it needs to go to other users, I need to do this instead
Code:
DisplayText(userName + txtYourMessage.Text + (char)13 + (char)10);
SendData("CHAT|" + txtYourMessage.Text);
However, in that way, it loses it's formatting. Do any of you know a way to still send the message to all connected clients but keep the formatting? Thanks.
-
Dec 29th, 2006, 01:09 PM
#2
Re: [2.0] Sockets question
Are you sending the text or the rtf text?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 29th, 2006, 02:59 PM
#3
Thread Starter
Frenzied Member
Re: [2.0] Sockets question
Well, I got the formatted text to show up on your screen when you send the message. But the whole sending messages thing works like this. You send the message to all attached clients, and to yourself. They are two different processes. I got the sending it to yourself working by just doing this:
Code:
txtMessages.AppendText(userName);
txtMessages.SelectedRtf = txtYourMessage.Rtf;
That ONLY shows up on your screen. The SendData with "CHAT|" sends it to all attached clients. However, if I send the text, then it loses it's formatting, if I send the string, it, also loses it's formatting. So, I'll send the .Rtf. However, when I do that, it shows up to all attached clients with no formatting, but it has formatting codes.
The solution to this predicament may be handling the message recieved event and set the selected rtf to their rtf. So, I suppose I would, convert all the rtf codes from the message to the format without codes when the message is recieved. I think I know how to do this. I'll reply with my status in a few.
-
Dec 29th, 2006, 03:01 PM
#4
Re: [2.0] Sockets question
Thats probably because your receiving rtf textbox is being set with the .Text property instead of the .RTF property.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 29th, 2006, 03:03 PM
#5
Thread Starter
Frenzied Member
Re: [2.0] Sockets question
Yea, I think I know how to solve this. The user sends the message with all the Rtf codes. Then, when the user recieves it, the SelectedRtf property of the messagelog is set to the rtf codes of the message.
-
Dec 29th, 2006, 03:04 PM
#6
Re: [2.0] Sockets question
Yes, sending and receiving the rtf should produce what you want.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|