如何在文本框中打断文本 [英] how to break a text in a textbox

查看:90
本文介绍了如何在文本框中打断文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

盖兹.
我发现如何难以在文本框中破坏一条语句(例如:如果我编写textbox1.text-信息技术"''),那么这两个词应放在单独的行中显示,例如
(信息
技术).我为此竭尽全力,但我只是在同一点旋转

hi guyz.
I find how to break a statement difficult in the textbox( for example: if i write textbox1.text - ''''information technology'''') so this two words should be display in a seperate line, like
(information
technology). I tried my best for that but i''m just rotating in the same point

推荐答案

确保文本框的"Multiline"属性设置为true ,然后执行类似的操作:
Make sure the "Multiline" property of the textbox is set to true, and do something like:
textbox1.Text = yourString.Replace(" ", "\n")



(\n可能需要为\r\n,我不记得TextBox是如何处理它的.)



(The \n may need to be \r\n, I don''t remember how TextBox handles it.)


假定您已将Textbox的multiline 属性设置为是的.

Assuming that you have set the multiline property of the Textbox to true.

Textbox1.Text = "This is a " & Environment.Newline & "Test to see if it works"


Textbox1.text = textbox1.text.replace( " ", vbcrlf )


这篇关于如何在文本框中打断文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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