Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建几个这样的 WPF 窗口:
flightWindow = new FlightWindow(txbNextFlight.Text, airline); flightWindow.Show();
当我单击此窗口内的按钮时,我希望窗口关闭。不知道如何解决这个问题?
using System; using System.Windows; namespace WpfApplication1 { public partial class FlightWindow : Window { public FlightWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { this.Close(); } } }