C# 将焦点锁定到窗口WPF
我在应用程序的开头添加了一个公开窗口。我希望窗口是用户在关闭前可以与之交互的唯一窗口。我在谷歌上搜索了一下,结果一无所获 谢谢C# 将焦点锁定到窗口WPF,c#,wpf,C#,Wpf,我在应用程序的开头添加了一个公开窗口。我希望窗口是用户在关闭前可以与之交互的唯一窗口。我在谷歌上搜索了一下,结果一无所获 谢谢 Joseph也许你想要模态对话框?见方法 例如: App.xaml文件: <Application x:Class="WpfApplication3.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="h
Joseph也许你想要模态对话框?见方法 例如:
App.xaml文件:
<Application x:Class="WpfApplication3.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup" />
美丽的!谢谢,只要我需要。
public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
var w = new YourDisclosureWindowClass();
w.ShowDialog();
// whatever you need to run you entire application
}
}