简体   繁体   中英

UserControl with panel and buttons

My Windows UserControl has a Panel and 2 Buttons. The UserControl is located inside WindowsFormsHost inside a WPF application.
The UserControl receive a video from 3rd party api as a winform control that i load into the panel and when mouse hover certain point of the panel (video) i want to set buttons .visibile = true.

Right now I can only achieve this by setting the MouseEnter and MouseMove events on 3rd party api control..
I want to set events on the panel without being depended on the 3rd party control, but if I do so - does not fire these events since the panel is occupied with the control..

How do i set the Panel to handle the events?

You should be able to forward the events from the 3rd party control to your panel like this ...

private void yourPanel_MouseEnter(object sender, EventArgs e)
{
    // panel MouseEnter event;
}

private void thirdParyCtrl_MouseEnter(object sender, EventArgs e)
{
    this.yourPanel_MouseEnter(sender, e);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM