RenderMessageControlEventHandler
Namespace: Wisej.Web.Ext.ChatControl
Assembly: Wisej.Web.Ext.ChatControl (4.1.0.0)
Represents the method that will handle the RenderMessageControl event, fired when a Message needs a control to be displayed in the ChatBox.
- C#
- VB.NET
public delegate void RenderMessageControlEventHandler(Object sender, RenderMessageControlEventArgs e)
Public Delegate Sub RenderMessageControlEventHandler(ByVal sender As [Object], ByVal e As RenderMessageControlEventArgs)
Assign Control to supply a custom control. When no control is supplied, the message is displayed using an AutoSizeLabel.
Example:
chatBox.RenderMessageControl += (object sender, RenderMessageControlEventArgs e) =>
{
if (e.Message.ContentType == "image")
e.Control = new PictureBox { ImageSource = e.Message.Content, Size = new Size(200, 150) };
};
Parameters
| Name | Type | Description |
|---|---|---|
| sender | Object | The source of the event. |
| e | RenderMessageControlEventArgs | An instance of RenderMessageControlEventArgs containing the message that requires a control. |
Fired By
| Name | Description |
|---|---|
| ChatBox.RenderMessageControl | Fired when a Message needs a control to display its content. |