换行或回车符语法问题
我对编码还很陌生,这是我的问题。
Results->Text = "G55 > Y" + System::Convert::ToString(destY);
“结果”是一个System.Windows.Forms.Textbox“多行btw”,VS是这么说的。
该行工作正常,但我需要在末尾添加一个“新行或 CR”,以便我可以在 ToString 中使用不同的文字和不同的 var 重复该行。
几天来,我尝试了我读过的不同语法,但我无法让它接受其中任何一个。
或者甚至是一种完全不同的方式将文本输入到“结果”->“文本”中,从而允许整齐的多行使用。
旁注:由于我在 VC 中使用 ->Text 和 System::Convert::ToString,这段代码是否会被视为 c++、.net 或 CLI?加强我的搜索。
Im pretty new to coding, heres my problem.
Results->Text = "G55 > Y" + System::Convert::ToString(destY);
"Results" is a System.Windows.Forms.Textbox "multiline btw", or so says VS.
That line works fine, but i need a "new line or CR" at the end, so that i can repeat that line with different Literals and a different var in ToString.
For days now ive tried different syntax's ive read about, and i cant get it to take any of them.
Or even a complete different way to input text into Results->Text that would allow for tidy multiline use.
Sidenote: since im using ->Text and System::Convert::ToString in VC, would this code be considered just c++ or .net or CLI? to tighten my searches.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您尝试过
System::Environment::NewLine
吗?这将为您提供 Windows 上的 CrLf 以及这些平台上适用于 Linux/OS X 的任何内容。Have you tried
System::Environment::NewLine
? This will give you CrLf on Windows and whatever is correct for Linux/OS X on those platforms.由于完全不熟悉 .NET,我可能完全错误,但在行尾添加
+ "\n"
肯定可以完成这项工作吗?或者失败了,+“\r\n”
?Being completely unfamiliar with .NET, I could be completely wrong, but surely adding a
+ "\n"
to the end of your line would do the job? Or failing that, a+ "\r\n"
?