请问SplitContainer控件的splitContainer1_Panel1_MouseEnter事件如何在子控件里触发?
请问SplitContainer控件的splitContainer1_Panel1_MouseEnter事件如何在子控件里触发?
private void splitContainer1_Panel2_MouseEnter(object sender, EventArgs e)
{
if (checkBoxX4.Checked)
{
splitContainer1.SplitterDistance = 10;
panelEx2.Visible = false;
dataGridViewX4.Height = 610;
splitContainer1.Panel1.BackgroundImage = Resource1.back;
}
}
private void splitContainer1_Panel1_MouseEnter(object sender, EventArgs e)
{
if (checkBoxX4.Checked)
{
splitContainer1.SplitterDistance = 177;
panelEx2.Visible = true;
dataGridViewX4.Height = 458;
}
}
我把SplitContainer设置为上下分隔,当鼠标移到splitContainer1_Panel1和 splitContainer1_Panel2 时分别修改分隔条的位置,我在splitContainer1_Panel1和splitContainer1_Panel1分别放置了子控件panel3和 datagirdview3,并把两个子控件的dock属性设置为fill, 这时,因为子控件填满了splitContainer1_Panel1和splitContainer1_Panel2,导致无法触发splitContainer1_Panel1_MouseEnter和splitContainer1_Panel2_MouseEnter 这两个事件。
请问有什么办法可以让鼠标移到子控件panel3和 datagirdview3上面时也可以触发上面的两个事件呢? 谢谢~~~
我没分数,所以给得少了,不好意思~~
------解决方案--------------------可以给控件panel3和 datagirdview3上也加上事件,然后事件内代码直接调用
比如:splitContainer1_Panel2_MouseEnter(null,null);