亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法將 system.windows.forms.messageboxbuttons 轉換為

無法將 system.windows.forms.messageboxbuttons 轉換為

C#
慕蓋茨4494581 2023-05-13 15:54:50
我無法在我的 C# wpf 項目上發送消息,我已經導入了所有組件,但現在收到此錯誤MessageBoxButtons 出現錯誤“無法將 system.windows.forms.messageboxbuttons 轉換為 system.windows.messageboxbuttons”using System.Windows;using System;using System.Windows.Controls;using System.Drawing;using System.Drawing.Imaging;using System.Security;using MessageBox = System.Windows.MessageBox;using System.Text.RegularExpressions;using System.IO;using System.Collections.Generic;using System.Windows.Forms;      if (MessageBox.Show("test", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)                    {                        // user clicked yes                    }                    else                    {                        // user clicked no                    }
查看完整描述

1 回答

?
SMILET

TA貢獻1796條經驗 獲得超4個贊

你混合了 WPF/Winforms


為按鈕/圖像使用正確的名稱空間:


if (MessageBox.Show("test", "Confirm", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Question) == MessageBoxResult.Yes)

{

    // user clicked yes

}

else

{

    // user clicked no

}


查看完整回答
反對 回復 2023-05-13
  • 1 回答
  • 0 關注
  • 288 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號