在窗体Load里面手工添加事件绑定
private void Form1_Load(object sender, EventArgs e)
{
groupBox1.MouseDown += new MouseEventHandler(groupBox1_MouseDown);
groupBox1.MouseUp += new MouseEventHandler(groupBox1_MouseUp);
}
void groupBox1_MouseUp(object sender, MouseEventArgs e)
{
//鼠标弹起
}
void groupBox1_MouseDown(object sender, MouseEventArgs e)
{
//鼠标按下
}