views:

42

answers:

0

I'm trying to replace a control as soon as it's added to my panel derived class in the gui editor. But this simple code doesn't seem to work and the control is not replaced. Any ideas?

protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e)
    {
        base.OnControlAdded(e);
        e.Control.Location = new System.Drawing.Point(0, 0);
    }