Not sure if this belongs in the Winform or WPF forum... feel free to move if required.
.NET 4.0 WinForm project, VS 2010, WinXP SP3.
I've got a single WPF control I'm hosting in a ElementHost in my main WinForm application. It basically implements a System.Windows.Controls.Input.Toolkit.AutoCompleteBox because the native Winform textbox autocomplete is far too buggy for dynamic queries
from a database, along with a Find button and a few radio buttons.
I'd like to hook up the WinForm AcceptButton to the WPF control's Find button, but of course one cannot simply do a direct assignment because they're different types of controls. If you try, you'll get:
WpfSearch wpf = ehWpf.Child as WpfSearch;
this.AcceptButton = wpf.btnFind;
Cannot implicitly convert type 'System.Windows.Controls.Button' to 'System.Windows.Forms.IButtonControl'. An explicit conversion exists (are you missing a cast?)
Yes, I've already made the WPF Find button IsDefault, but that doesn't get translated over into the Winform apparently.
While I know I can intercept the Winform's KeyPress Event and check if it's the ENTER key, I'd rather a more 'natural' appro
View Complete Post