用vb6连接字符串

编程入门 行业动态 更新时间:2024-10-28 10:35:07
本文介绍了用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连接字符串

本文发布于:2023-10-28 13:08:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536721.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!