在WPF中的消息框上没有得到正确的输出 [英] Not getting the right output on message box in wpf

查看:94
本文介绍了在WPF中的消息框上没有得到正确的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的WPF应用程序中,我有一个MessageBox,应该显示
您的幸运数字是i和j"

(其中i和j是整数类型的局部变量中存在的一些数字)

这是我的代码,

In my WPF application, I have a MessageBox which is supposed to show
"your lucky numbers are i and j"

(where i and j are some numbers present in the local variables of integer type)

This is my code,

MessageBox.Show(string.Format("your lucky numbers are", i + 1, "and", j + 1));




任何帮助将非常感激.感谢




Any help would be much appreciated. thanks

推荐答案

尝试一下:-

Try this:-

MessageBox.Show(string.Format("your lucky numbers are{0} and {1}", (j + 1).ToString(), (i + 1).ToString()));



希望对您有帮助



Hope this helps


这篇关于在WPF中的消息框上没有得到正确的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆