vb 函数 问题请会的朋友帮忙看一下那里错了

来源:百度知道 编辑:UC知道 时间:2024/05/11 13:16:25
客房登记表.要求登记房客的姓名、性别、证件号码、登记房号、入住时间和退房时间。
1)在窗体上摆放7个标签(labe)控件,7个文本(text)框控件和3个命令按扭(command)控件。
2)下面是我写的代码(其中vbcrlf没有起到“回车”做用问题就发生在这里)
private sub command1_click()
text7.text= "姓名:" & text1 & vbcrlf
text7.text= text7 & "性别:" & text2 & vbcrlf
text7.text=text7 &"证件号码:" & text3 & vbcrlf
text7.text=text7 & "登记房号:" & text4 & vbcrlf
text7.text=text7 & "入住时间" & text5 & vbcrlf
text7.text=text7 &"退房时间:"& text6 & vbcrlf
end sub
本来在这个程序中vbcrlf是代表“回车”的但现在只是一串的把所有结果都输出在text7中的

1)实际的出去是这样的结果

性名:xxx 性别:xxxxx 证件号:xxx登记房号:xxx入住时间:xx退房时间:xxxx

2)设想因该是这样的结果
性名:xxx
性别:xxx
证件号:xxxxx
登记房号:xxxxxxxxxxx
入住时间:xxxxx
退房时间:xxxxxx

在Text7属性页,将MultiLine设置为True

text7.text= "姓名:" & text1 & vbcrlf & "性别:"&_ text2 & vbcrlf &"证件号码:" & text3 & vbcrlf & "登记房_号:" & text4 & vbcrlf & "入住时间" & text5 & vbcrlf_ &"退房时间:"& text6 & vbcrlf

写在一行里试试