日期:2014-05-17 浏览次数:20919 次
Window1 dialog;
public MainWindow()
{
...
dialog = new Window1();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
dialog.Owner = this;
dialog.ShowDialog();
}
Window1 dialog;
private void button1_Click(object sender, RoutedEventArgs e)
{
dialog = new Window1();
dialog.Owner = this;
dialog.ShowDialog();
}
Window1 dialog;
public MainWindow()
{
...
dialog = new Window1();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
this.Focusable = false;
this.IsEnabled = false;
dialog.Owner = this;
dialog.Show();
}
// 在Window1的代码里,禁止该窗口关闭。当对话框退出时,仅仅调用Hide,并重新把MainWindow的对应属性设回true
public partial class Form1 : Form
{
private Form2 frm;
public Form1()
{
InitializeComponent();
}