Click here to Skip to main content
15,895,084 members
Articles / Programming Languages / C#

LumiSoft MailServer

Rate me:
Please Sign up or sign in to vote.
3.79/5 (22 votes)
17 Nov 2006CPOL1 min read 323.1K   4.9K   74  
Full featured SMTP/POP3/IMAP server
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Estonia Estonia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions