This is a migrated thread and some comments may be shown as answers.

Emotes and Color

4 Answers 65 Views
Conversational UI, Chat
This is a migrated thread and some comments may be shown as answers.
lehrbua
Top achievements
Rank 2
lehrbua asked on 18 May 2018, 06:45 PM

Hello,

is it possible to display emotes in a message and edit the color of the name ??
Ive added an Example of what i mean.

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 May 2018, 12:32 PM
Hello, Erwin,     

By design, RadChat doesn't support emoticons. However, it is a nice-to-have feature. That is why I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

As to the color of the name, note that the ChatMessageNameElement in the TextMessageItemElement displays the time of the message and author's name. You can customize the appearance by handling the RadChat.ItemFormatting event. Here is a sample code snippet how to change the fore color to red for the name element: 
private void radChat1_ItemFormatting(object sender, ChatItemElementEventArgs e)
{
    TextMessageItemElement messageElement = e.ItemElement as TextMessageItemElement;
    if (messageElement!=null)
    {
        messageElement.NameLabelElement.ForeColor = Color.Red;
    }
}



Since one element shows the time of the message and the name of the author, both are affected by the red fore color. If you need just a part of the text to be colored, it is appropriate to use HTML-like text formatting as follows: 

private void radChat1_ItemFormatting(object sender, ChatItemElementEventArgs e)
{
    TextMessageItemElement messageElement = e.ItemElement as TextMessageItemElement;
    if (messageElement != null)
    {
        string[] tokens = messageElement.NameLabelElement.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
        if (tokens.Length > 1)
        {
            messageElement.NameLabelElement.DisableHTMLRendering = false;
            messageElement.NameLabelElement.Text = "<html>" + tokens[0] + "<color=red>" + tokens[1];
        }
    }
}




I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress TelerikRadChat for Winforms
0
lehrbua
Top achievements
Rank 2
answered on 29 May 2018, 01:17 PM
Thank you very much :)
0
Stephen
Top achievements
Rank 1
answered on 30 Nov 2018, 12:16 AM
+1 for emoticon support.  The feedback portal link does not go anywhere for me; is there a way I can follow the progress of this item?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Nov 2018, 05:56 AM
Hello, Stephen,    

I have missed to provide the link. Please excuse me for the misunderstanding. You can track its progress, subscribe for status changes and add your comments on the following link : https://feedback.progress.com/Project/154/feedback/Details/249998-add-radchat-emoticons-emojis-support

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress TelerikRadChat for Winforms
Tags
Conversational UI, Chat
Asked by
lehrbua
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
lehrbua
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
Share this question
or