Applying vbCrLf to the content of a textbox

烈酒焚心 提交于 2019-12-24 02:45:24

问题


I've got a userform within an Excel vba project. At design-time it is empty.

In the form initialize event I've got the following code:

Private Sub UserForm_Initialize()

txtSQL.value = _
    "SELECT MyName = ""ColY"" " & vbCrLf & _
    "FROM SomeTable " & vbCrLf & _
    "GROUP BY Customer " & vbCrLf & _
    "ORDER BY Customer DESC"

End Sub

I was hoping for 4 separate lines of text in the textbox but instead have the following:

Am I using the wrong control? Or am I using the right control in the wrong way?


回答1:


Whoops: maybe I should go to bed...

At design-time set multi-line property to True!



来源:https://stackoverflow.com/questions/19369682/applying-vbcrlf-to-the-content-of-a-textbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!