最近我遇到過這個問題。我經常使用WPF/C#編寫程序,並且想要使用OpenFileDialog
或其他需要System.Windows.Forms
的類。我也經常使用MessageBoxes(當添加Forms時,它們在兩個庫之間變得模糊)。避免在WPF中使用MessageBox引起歧義
我添加了參考,但(即使使用快捷方式),我不得不使用類似F.MessageBox.Show()
之類的東西。有沒有辦法在我需要的時候暫時使用System.Windows.Forms
參考或其他可以讓我保持MessageBox.Show()
完整的參考?
[System.Windows.MessageBox VS System.Windows.Forms.MessageBox](的可能的複製http://stackoverflow.com/questions/4660587/system-windows-messagebox-vs-system-windows-forms -messagebox) – 2016-05-17 18:19:56