gpt4 book ai didi

c# - 如何自定义MessageBox提示?

转载 作者:太空宇宙 更新时间:2023-11-03 12:46:26 25 4
gpt4 key购买 nike

此例程广泛用于向最终用户提示是/否确认:

var result = DXMessageBox.Show(Application.Current.MainWindow, 
"Whatever",
"Attention",
MessageBoxButton.OKCancel, ////////////// here
MessageBoxImage.Question);

if (result == MessageBoxResult.OK) // then instead of this, it shall check some customized settings
{
// confirmed for Orange for example
}
else
{
// confirmed for Elephant for example
}

我不想要 YesNoOKCancel 或其他。 如何自定义按钮?我希望用户能够执行类似于“用户按下按钮,应用程序提示两个选择,用户选择一个”的操作。但我想将指定的选项、文本和大小与 MessageBox 的简单性结合起来?

P.S DVMessageBoxSystem.Windows.MessageBox 在这里差不多。

最佳答案

在我看来,您只想创建自定义控件。有很多文章:
One
Two
Three

此外,您可以通过标准 WPF 控件模板创建完全可自定义的 MessageBox。请see an example .

关于c# - 如何自定义MessageBox提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37165897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com