Thanks Clay,
The OnMouseDown event only seems to fire when I "create" the pane by dragging the splitter from the lower right corner. If I release the splitter and then click on it again (this time in the middle of the screen) the OnMouseDown event does not fire. I hope this makes sense.
Any other ideas?
Thanks
Per
>The only way I know to do this is to derive the control and ignore the MouseUp if it is outside the grid. Here is a try at this. You will want to tweak the values to get the behavior you want.
>
>public class MySplitterControl : SplitterControl
>{
> private Point downPT;
> protected override void OnMouseDown(MouseEventArgs e)
> {
> downPT = new Point(e.X, e.Y);
> base.OnMouseDown (e);
> }
>
> protected override void OnMouseUp(MouseEventArgs e)
> {
> Point pt = new Point(e.X, e.Y);
> if(pt.Y < 40 || pt.Y > this.Height - 40
> || pt.X < 40 || pt.X > this.Width - 4)
> {
> MouseEventArgs e1 = new MouseEventArgs(e.Button, e.Clicks, downPT.X, downPT.Y, e.Delta);
> base.OnMouseUp(e1);
> return;
> }
> base.OnMouseUp (e);
> }
>}
>