Проблема с Control-ом
public partial class CustomControl1 : TreeView
{
public CustomControl1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
// TODO: Add custom paint code here
MessageBox.Show("");
// Calling the base class OnPaint
base.OnPaint(pe);
}
не вызывает OnPaint, почему?
Цитата: Egor2
Код не вызывает OnPaint, почему?
Потому что TreeView не гнерирует подобного события.
TreeView генерирует событие DrawNode при свойстве DrawMode поставленном в одно из состояний OwnerDrawXXX.