我有一个使用system.windows.controls.printdialog:
的wpf usercontrolxaml:
<UserControl x:Class="WpfControlLibrary1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Button Click="Button_Click"/>
</UserControl>
codebehind:
namespace WpfControlLibrary1
{
using System.Windows;
using System.Windows.Controls;
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var printer = new PrintDialog();
printer.ShowDialog();
}
}
}
如果我现在在wpf应用程序中使用此usercontrol,则printDialog-windows显示为模态对话框。(如MSDN中所述)
但是,如果我在奇迹形式的应用程序中使用usercontrol,则该对话框显示为非模式对话框。
任何人都知道,当我在Windows-Forms应用程序中托管USERCORTROL时,我如何将printdialog称为模态对话框?
感谢您的期待RHE1980
解决方案/解决方案(在德语中):
http://mobilesolutions.noser.com/2013/01/winforms-meets-wpf-meets-winforms-winforms-meets-wpf-2/