本文介绍了用vb6连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在vb6中进行连接。不支持运算符+ =,我想做下面的代码。我想在程序中处理更多代码时在文本框中添加更多字符串。谁能建议将+ =更改为什么?我知道&可以在将一个字符串添加到另一个字符串时使用,但这在我在此工作的示例中似乎不合适。
I am trying to concatenate in vb6. The operator += is not supported, and I want to do something like the code below. I want to add more strings to a textbox as the program works down this code. Can anyone advise what to change += to? I know & can be used when adding one string to another, but it the example I am working on here, that doesn't seem suitable.
谢谢。
If (strHomeNo <> "") Then txtPhoneNums = "Home: " + strHomeNo End If If (strMobileNo <> "") Then txtPhoneNums += "Mobile: " + strMobileNo End If If (strWorkNo <> "") Then txtPhoneNums += "Work: " + strWorkNo End If If (txtPhoneNums <> "") Then txtPhoneNums.ForeColor = vbBlack txtPhoneNums.FontBold = False End If Else txtPhoneNums.Text = "NO CONTACT DETAILS" txtPhoneNums.ForeColor = vbRed txtPhoneNums.FontBold = True推荐答案
将:
txtPhoneNums = txtPhoneNums & "Work: " & strWorkNo不起作用?
更多推荐
用vb6连接字符串
发布评论