[英]Messagebox not showing full content
我使用以下代码通过MessageBox
向我的应用程序的用户提问:
var site = Registry.GetValue("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters",
"DynamicSiteName", "Unconnected") as string;
var selectedSite = (Options.GetUserSetting("Site", "SelectedSite"));
if () // Some checks go here
{
DialogResult ret = MessageBox.Show(
string.Format("The selected site is {0}. But you're in {1}...{2}Want to change it ?", selectedSite, site.Trim(), Environment.NewLine),
"Stupid default selection...",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
// Some process goes here
}
显示带有以下文本的MessageBox
:
所选站点为[SelectedSiteNameGoesHere]。 但是你在[SiteGoesHere]
这有点令人不安,因为我不理解为什么字符串会被分割。
如果我将site
替换为硬编码的字符串,则会正常显示该消息。
如何找回缺失的部分?
这是我的输出:
这是我想要的输出:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.