日期:2014-05-17 浏览次数:20815 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
namespace TestUI
{
public partial class UISplitContainer : SplitContainer
{
public UISplitContainer()
{
InitializeComponent();
}
public UISplitContainer(IContainer container)
{
container.Add(this);
this.Invalidate();
InitializeComponent();
SetStyles();
}
private void SetStyles()
{
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
UpdateStyles();
}
protected override void OnPrint(PaintEventArgs e)
{
MessageBox.Show("hi");//为什么不执行这函数??????
}
}
}