Reputation: 85
I want to concat two strings and I need the name of a combo box to be the result of concatenation. For example,
parametre = hi
parametre2 = everyone
I have put name hieveryone my combobox name
parametre3 = String.Concat(parametre,parametre2)
dim parametre3 as ComboBox
How can I do solve this problem?
Upvotes: 0
Views: 91
Reputation: 26941
Dim parameter1 As New String("Hi");
Dim parameter2 As New String("everyone");
Dim combo As New ComboBox();
combo.Name = String.Concat(parameter1, parameter2);
Upvotes: 0
Reputation: 1500575
You can't do this. Variable naming occurs at compile time, whereas the string concatenation occurs at execution time.
Generally, if you want to dynamically map strings to values, you should use a Dictionary(Of String, Of ComboBox)
or whatever. Then you can put values into the dictionary by string key, and retrieve them later.
Upvotes: 2