Pete Pete - 2 years ago 82
HTML Question

Concatenation of String and Control in VB

I am having an issue integrating Skype html codes with my .vb tool to edit the mood profile.

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

Skype.CurrentUserProfile.RichMoodText = "<spinner></spinner>" & TextBox2 & "<spinner></spinner>"

End Sub

Although this works with the other html codes, it refuses to work for the spinner tag, as well as the blink tag.
I have tried replacing the & with + to no avail. Here is the error I get:

Severity Code Description Project File Line Suppression State
Error BC30452 Operator '&' is not defined for types 'String' and 'TextBox'.

Answer Source

& is used to join two strings together. TextBox2 is the name of a textbox control and the control cannot be joined to a string.

Try using the text property of the control instead

Skype.CurrentUserProfile.RichMoodText = "<spinner></spinner>" & TextBox2.Text & "<spinner></spinner>"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download