I have a modal created for a WinForm that shows when user click the “Save” button. Instead of showing the MessageBox, I want to know if it’s possible to incorporate a WPF control I’ve created instead? Here’s my code.
Form frmModal = new Form();
frmModal.BackColor = Color.Black;
frmModal.WindowState = FormWindowState.Maximized;
frmModal.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
frmModal.Opacity = 0.6;
frmModal.Show(); //--> want to replace with WPF control
MessageBox.Show("Hello");
frmModal.Close();
frmModal.Dispose();
Yes you will need to bring up a new form window which uses a winform ElementHost control to show the WPF control.