菜鸟提问,关于类的重写

chinadforce 2006-02-18 04:50:15
现有这个
MessageBox.Show("请选择一个要灌水的论坛类型!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);


我想省略写成
haha.Show("请选择一个要灌水的论坛类型!", "错误提示";他的效果和MessageBox.Show("请选择一个要灌水的论坛类型!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);一样,改怎么写
...全文
75 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lidong6 2006-02-18
  • 打赏
  • 举报
回复
MessageBox.Show本身就有这个重载啊:
public static DialogResult Show(string, string);
chinadforce 2006-02-18
  • 打赏
  • 举报
回复
不行啊,我也是这样写的,提示要要采用"5"个数的重载?
niwalker 2006-02-18
  • 打赏
  • 举报
回复
更正: public Haha = public class Haha
niwalker 2006-02-18
  • 打赏
  • 举报
回复
public Haha
{
public static void Show(string msg, string title)
{
MessageBox.Show(msg, title, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
}
}

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧