Is there any way to run a button's event handler from code?
I tried
btn.click(); btn.mousedown();
I tried calling the event handler but I didn't know what parameter goes to RoutedEventArgs e
you can directly call the button using btn.click();
and btn.mousedown();
and pass a new EventArgs(
) RoutedEventArgs.
Like
btn.click(btn,new EventArgs());
You can also call
btn.PerformClick();
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.