请协助解决我的TextBox问题 [英] Please help with my TextBox issue
本文介绍了请协助解决我的TextBox问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在尝试制作有关如何开始制作编程语言的教程系列,而第一个教程之一就是做到这一点:
hey guys,
i am trying to make a tutorial series on how to get started on making a programming language and one of the first tutorials are to do this:
for each a as string in textbox1.text.split(controlchars.lf)
if a.startswith("print ")
textbox2.text &= a.substring(6
end if
next
如果您去运行此代码,它将运行正常.但您将无法换行.我希望能够使用换行"命令换行,但我不知道该怎么做.你们能给我一个针对每个"陈述的答案吗?这是您可以尝试的示例代码:
if you go and run this code, it will run just fine. but you will not be able to make new lines. i want to be able to make a new line with the command ''newline'' but i don''t know how to. can you guys please give me an answer that is in the ''for each'' statement? this is a sample code that you can try:
print Hello World
newline
print Something
结果:
result:
Hello World
Something
推荐答案
不要以为您最好理解一下正在发生的事情以及如何做事 之前 ,您开始写教程吗?
我非常确定,任何由初学者编写的教程都会错过很多重要的东西.例如,您的示例中缺少使用StringBuilder类,使用了Visual Studio默认名称...
试试这个:
Don''t you think it would be a good idea for you to understand what is going on and how to do things before you start writing tutorials?
I''m pretty sure that any tutorial written by a beginner is going to miss out a lot of important stuff. For example, the lack of use of the StringBuilder class in your example, the use of Visual studio default names...
Try this:
textBox2.Text = "Hello" + Environment.NewLine & "Goodbye"
您好,
请检查此内容-
您是否已将文本框属性设置为多行?
尝试使用VbCrlf
将其用于VB.NET中的换行符
Hi,
Please check for this-
Have you set your textbox property to multiline?
try usingVbCrlf
it is used for newline in VB.NET
使用foreach非常简单:
Using foreach is simple enough:
for each a as string in textbox1.lines()
.
.
next
这篇关于请协助解决我的TextBox问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文