我想使程序名稱青色Pembuat SOAL(青色問題製造者)我在啓動事件添加到該代碼:爲什麼WPF窗口沒有打開
using System;
using System.Windows;
namespace Cyan_Pembuat_Soal {
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application {
private void Application_Startup(object sender, StartupEventArgs e){
if (FindPlace(e.Args) != null) {
Cyan_Pembuat_Soal.MainWindow a = new Cyan_Pembuat_Soal.MainWindow();
a.Activate();
} else {
Cyan_Pembuat_Soal.MainWindow a = new Cyan_Pembuat_Soal.MainWindow();
a.Activate();
a.Closed += delegate(object senders, EventArgs es) {this.Shutdown();};
}
}
private static string FindPlace(string[] a) {
if (a.Length == 0) {
return null;
}
int b = 0;
System.Uri c;
for (b = 0; b < a.Length; b++) {
if(Uri.TryCreate(a[b], UriKind.RelativeOrAbsolute, out c)){
break;
}
}
c = null;
return a[b];
}
}
}
但是,代碼沒有正常工作。這個計劃有什麼問題?
使用'a.Show()''不a.Activate()' – Snowbear 2012-08-03 08:14:00