Poznakomlus, не так случайно?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DesingeSlideTab
{
public class SlideForm: Form
{
private bool _hover = false;
public delegate void ChangeBox(bool value);
public event ChangeBox ChangeMininizeBox;
public event ChangeBox ChangeMaximizeBox;
public bool IsTilteBar
{
get { return _hover; }
set
{
_hover = value;
}
}
private int WS_CAPTION = (int)0x00C00000L;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style &= ~WS_CAPTION;
return cp;
}
}
private const int WM_NCHITTEST = 0x84;
private const int HTCAPTION = 0x2;
private const int HTCLIENT = 0x1;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_NCHITTEST && _hover && (int)m.Result == HTCLIENT)
{
m.Result = (IntPtr)HTCAPTION;
}
}
public new bool MaximizeBox
{
get { return base.MaximizeBox; }
set {
base.MaximizeBox = value;
if (ChangeMaximizeBox != null)
ChangeMaximizeBox(value);
}
}
public new bool MinimizeBox
{
get { return base.MinimizeBox; }
set
{
base.MinimizeBox = value;
if (ChangeMininizeBox != null)
ChangeMininizeBox(value);
}
}
}
}