社区
C#
帖子详情
MessageBox 怎么得到返回的Yes , No , Cancel?
sskset
2005-03-17 03:54:08
rt
...全文
634
8
打赏
收藏
MessageBox 怎么得到返回的Yes , No , Cancel?
rt
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sskset
2005-03-17
打赏
举报
回复
up
xxc1981
2005-03-17
打赏
举报
回复
不好意思 写错了,没测试
8u9
2005-03-17
打赏
举报
回复
MessageBox.Show("hello","this world",MessageboxButton.YesNo,MessageBoxIcon.Hand)
也可以
sskset
2005-03-17
打赏
举报
回复
switch (MessageBox.Show("File Changed !!!\nDo You want to save the File?","Warning!!!",MessageBoxButtons.YesNoCancel))
{
case DialogResult.Yes:
MessageBox.Show("777");
break;
case DialogResult.No:
Environment.Exit(0);
default:
break;
}
这样为什么不行?
coolksj
2005-03-17
打赏
举报
回复
if(MessageBox("",...)==yes)
{...}
else
{...}
VFanYan
2005-03-17
打赏
举报
回复
MessageBox("aa",……)==DialogResult.Yes
8u9
2005-03-17
打赏
举报
回复
private void InitializeMyButton()
{
// Create and initialize a Button.
Button button1 = new Button();
// Set the button to return a value of OK when clicked.
button1.DialogResult = DialogResult.OK;
// Add the button to the form.
Controls.Add(button1);
}
xxc1981
2005-03-17
打赏
举报
回复
bool isTrue=MessageBox.Show("OK?","",MessageBoxButtons.YesNoCancel);
C#中
MessageBox
用法大全
- 设置不同的按钮组合(如
Yes
/No、Abort/Retry/Ignore等); - 设置消息框的字体样式; - 设置消息框的模态级别等。 对于更详细的使用方法,可以查阅 MSDN 上关于 `
MessageBox
` 类的官方文档。此外,还可以通过查阅...
C#中
MessageBox
用法大全(附效果图)
- **Buttons** - 显示的按钮类型,如`OK`, `Can
cel
`, `
Yes
No`等。 - **Icon** - 消息框图标,如`Question`, `Exclamation`, `Information`等。 - **DefaultButton** - 默认激活的按钮。 - **Options** - 消息框显示...
C#中
MessageBox
用法大全(附效果图).
- 使用`
MessageBox
Buttons.
Yes
NoCan
cel
`、`
MessageBox
Buttons.
Yes
No`等按钮布局。 - 设置不同的图标样式,如`MessageIcon.Exclamation`、`MessageIcon.Stop`等。 - 调整消息框的位置和大小。 - 更改字体和颜色等。 ...
在窗体退出前弹出对话框C#源代码
", "确认退出",
MessageBox
Buttons.
Yes
No,
MessageBox
Icon.Question); // 如果用户点击了"否",则取消关闭操作 if (result == DialogResult.No) { e.Can
cel
= true; // 取消关闭 } } } ``` 这段代码中,`...
C#
MessageBox
.Show 方法重载
", "警告",
MessageBox
Buttons.
Yes
No,
MessageBox
Icon.Warning)`,展示一个带有"是"和"否"按钮并显示警告图标的对话框。 在文档"
MessageBox
.Show 重载方法.doc"中,可能详细列举了所有重载形式及其用法,供开发者...
C#
111,094
社区成员
642,554
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章