Skip to main content

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.

public delegate void RenderMessageControlEventHandler(Object sender, RenderMessageControlEventArgs e)

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​

NameTypeDescription
senderObjectThe source of the event.
eRenderMessageControlEventArgsAn instance of RenderMessageControlEventArgs containing the message that requires a control.

Fired By​

NameDescription
ChatBox.RenderMessageControlFired when a Message needs a control to display its content.