Variable with other variable

  • Thread starter Thread starter Mrozu
  • Start date Start date
M

Mrozu

Hi

How can I include in name of my variable value of other variable? I
have following code:


For x = 0 To 10

Dim column As New DataGridTextBoxColumn
column.MappingName = magazyny(x)
column.HeaderText = magazyny_wys(x)
column.Width = 100
TblStyle.GridColumnStyles.Add(column)

Next

and what i can do with variable Column?! I need sth like that:

Dim column + x As New DataGridTextBoxColumn

Or maybe u know other way to add several columns to tablestyle using
For loop

Thx Mrozu
 
Why do you think that you need that? Is there some problem with the code
as it is now?

You can use an array if you want to keep references to the columns.
 
God... it really works... I don't know what's going on:) Thx man.

But is it possible to add to variable name value of other variable?


Thx Mrozu
 
No, there is no way to create variables dynamically. If you want to
store named values dynamically you should use a collection. Or if the
names only differ by index like in your example, an array.
 
Back
Top