|
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace LumiSoft.MailServer.UI
{
/// <summary>
/// Extend RichTextBox. Adds support for this.SuspendPaint.
/// </summary>
public class WRichTextBox : RichTextBox
{
private bool m_SuspendPaint = false;
/// <summary>
/// Default constructor.
/// </summary>
public WRichTextBox()
{
}
#region method override WndProc
protected override void WndProc(ref System.Windows.Forms.Message m)
{
// WM_PAINT = 0x00f
if(m.Msg == 0x00f){
if(m_SuspendPaint){
m.Result = IntPtr.Zero;
}
else{
base.WndProc(ref m);
}
}
else{
base.WndProc(ref m);
}
}
#endregion
#region Properties Implementation
/// <summary>
/// Gets or sets if painting is suspended.
/// </summary>
public bool SuspendPaint
{
get{ return m_SuspendPaint; }
set{
m_SuspendPaint = value;
if(!value){
this.Refresh();
}
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.