public MainWindow() { InitializeComponent(); WindowsFormsHost host = new WindowsFormsHost(); // Create the MaskedTextBox control. FlyleafPlayer flyleaf = new FlyleafPlayer(); flyleaf.isWPF = true; flyleaf.config.hookForm._Enabled = false; host.Child = flyleaf; this.grid1.Children.Add(host); }
private void flyLeaf_GotFocus(object sender, EventArgs e) { if (sender.GetType() == typeof(FlyleafPlayer)) { FlyleafPlayer flyleaf = ((FlyleafPlayer)sender); switch (flyleaf.Name) { case "flyLeaf1": if (activeRow == 0 && activeColumn == 0) { return; } activeRow = 0; activeColumn = 0; break; case "flyLeaf2": if (activeRow == 0 && activeColumn == 1) { return; } activeRow = 0; activeColumn = 1; break; case "flyLeaf3": if (activeRow == 1 && activeColumn == 0) { return; } activeRow = 1; activeColumn = 0; break; case "flyLeaf4": if (activeRow == 1 && activeColumn == 1) { return; } activeRow = 1; activeColumn = 1; break; } tableLayoutPanel1.Refresh(); flyleaf.Focus(); } }