using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace Telerik.WinControls
{
    public class RadSplitContainer: SplitContainer
    {
        public RadSplitContainer()
        {
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            MethodInfo setStyleMethod = typeof (Control).GetMethod("SetStyle",
                                                         BindingFlags.Instance | BindingFlags.InvokeMethod |
                                                         BindingFlags.NonPublic);

            if (setStyleMethod != null)
            {
                setStyleMethod.Invoke(this.Panel1, new object[] { ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true });
                
                setStyleMethod.Invoke(this.Panel2, new object[] { ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true });
            }
        }
    }
}
