C# Chat - how to show messages decently? - c#

im making a Chat client and server.. everything was for the best, thread, connections, all ok.
But now my C# program got a problem..
..i searched for hours and days without solution
Its my problem:
I need to replace the (classic) textbox for reading, with something that supports color, smile, font, maybe interactive features.
RichTextBox? No GIF support or interactive items
i like fastcoloredtextbox but cant change font or font-size (it's possible but does not work well) btw not right for me
I would use a Browser, which allows me to use html, css and javascript, so to solve all my problems..
Why i cant?
Geckofx? Don't work [!?] :|
Standard WebBrowser suck. I had Windows 8, but still IE9 (wtf?).
Awesomium? It's ok but can't modify the document...
should i create a blank html page and insert all through javascript?
any solution? what do you suggest?
[it's a desktop app, i'm using vs2010]
thanks
EDIT: Got a solution.
WebSockets is the way..! :3

I found a few links that could be useful if you want to use rtf:
http://www.codeproject.com/Articles/4544/Insert-Plain-Text-and-Images-into-RichTextBox-at-R
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/fe9bfcb7-b226-4a54-9882-11c699bf1cb4/
How can I make a hyperlink work in a RichTextBox?
C# / WPF: Richtextbox: Find all Images
But there are many possible answers to this question, so its really up to you how you want to display the messages.

Related

WinForms html textBox

I am looking for a simple textBox with Html capabilities like https://jhollingworth.github.io/bootstrap-wysihtml5/
I want to use it in a desktop program.
I have searched a bit but I find rather old components. I would like a free one if it is possible and not a whole suite like devexpress.
Thanks
I've used the "HtmlTextbox for Windows.Forms" control a while back for a very small portion of an application. It served it's purpose perfectly for what I needed to accomplish. It's open source on CodePlex. It hasn't been updated since 2012, but then again not much has changed with WinForms since the release of WPF. Give it a try, hopefully it works for you.
https://winformhtmltextbox.codeplex.com/

Is it possible to change browser icon(in taskBar) using C# for website?

My client asked me to change the default Browser Logo to Website Logo(in task Bar).I have searched for the various ways to achieve it.But all my trails went wrong.May i know whether it possible for a C# ASP Website.Please help me to complete this.
I don't know this is a correct question or not.If you said its possibility,It might be very helpful for me.
Thanks,
Rakesh.
This isn't possible.
The browser icon is the icon chosen for that particular piece of software, for that operating system.
You could set a favicon, which with some browsers may change the software icon, but this is not something you will be able to do consistently.

Simplest DIY datepicker and timepicker for a Metro app (c# & XAML)

I am working on a Metro app, and as far as I know there is no datepicker control available ATM. In my app the user is working with dates, and I am looking for a way to make this less painfull for the user.
What would be the best way to go about it? Anybody have a nice custom control sample they would like to share?
I have the same problem with graphs, but I am hoping to get an access code to Teleriks preview to their Win8 controls, but I couldnt see any date or timepickers there.
Currently there is not a WinRT DatePicker as explained in this MSDN answer. Tim Heuer and some are working on some simple WinRT components. You can find their work, called Callisto, on Github. A DatePicker looks to be next on the list, but they could always use help as well. The best place to start would be the Windows Phone 7 DatePicker. You can download the source from Codeplex.
Telerik has now released the beta of their windows 8 controls, one of them being a datepicker! Problem solved :)

How to render a formula in WPF or WinForms

Update 2018 TL;DR; LaTEX for WPF
https://github.com/ForNeVeR/wpf-math
Original question
I need to have a way to draw a mathematical formula in Windows Forms or WPF. Some "FormulaTextBox" control would be exactly what I need.
I'm not asking about full implementation of LaTEX, but at least something beyond RichTextBox possibilities, with division lines, square roots, etc.
Here's a list of options, pulled from several webpages online, as well as a few similar questions on SO
WPF-Math, a WPF library for rendering math-related TeX markup.
gNumerator is a WinForms control that renders MathML. It is native C#, but appears to be quite old.
Math Expressions, a commercial WinForms control for displaying and editing math equations. Note: Not free
There's an unofficial port of JMathTex to a C# WPF control
The Windows version of the LaTex editor Lyx uses a native library called MikTex you could take a look at. I saw mention somewhere that the tex4ht package renders math equations to images
MimeTex/MathTex, as you already mentioned
You could also use a WebBrowser control, and just locally include one of many javascript libraries for rendering LaTex.
You could pawn off the work onto Microsoft Word (Example - requires users to have MS Word installed!)
Perhaps you can use the Wolfram Alpha API to retrieve the images.
If you want something beyond a RichTextBox abilities to render pie, divisions and sqr roots and etc, you could just use WebBrowserControl(s) as textbox's. Then to render formula's you could leverage techniques shown in this webpage, save it to your desktop and open the html file:
http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html
Obviously you'll need a special syntax (or special calculator buttons) to enter the formula's and I'm guessing from looking at the customisations.js file driving that webpage that you could make your own list of operators and functions too.
Here's what I'd do if none of the .NET specific solutions work for you:
It's a bit hacky, but it'll work and your users won't know the difference. Download the Mathjax library. When your user enters in the equation, you could convert the equation to LaTex or MathML. You would then take the LaTex or MathML and generate an HTML file that references Mathjax and display the file in your tiny WebBrowser window (valid for both WinForms and WPF). This shouldn't require an internet connection.
Like I said, your users won't be any the wiser.

Creating flash slideshlow c#

We have a few flash files f1.swf, f2.swf .... fn.swf.
We would like to be able to display a slide show of these different files in c# using winforms.
Each flash file is a slideshow by itself. At the end of slideshow for f1 we need to display a message and ask the user to repeat it or continue. Just wondering if anyone has any suggestions how to achieve this.
Thanks
N
I think this is what you're looking for: How to Play Flash (SWF) inside C#
EDIT:
also here is some interesting stuff: Example C# Code for Reading Flash (SWF) Files

Categories