but I want resize the length of array
my app recieve information from user , I don't know how many input will request user
app recieves information step by step
each step the length of information will increase
the rightmost dimention will be fixed
Const FIRST_DIM AsInteger = 9' First dimension gets fixed to ten elements
Dim Matrix(,)AsInteger
Dim Counter AsInteger' Counter for the second dimension of the matrix
Counter = 0' Reset counter
' A loop to process user input
Do Until <some condition>
' Resize second dimension
ReDim Preserve Matrix(FIRST_DIM, Counter)' ReDim Preserve preserves previous data in the matrix
' Process/add user data here
Counter += 1' Increase counter!
Loop
So, the first dimension stays always fixed. You have to design your app (or the organization of the data) so that the second dimension changes, not the first one. That's something you should always be able to do with two-dimensional arrays. It just may require a bit changing the way you think of organizing the data
Ok
I though on that
but when I do it , the text of label is not appearing completly
I didn't change any thing except replacing the place of dimension for array ..??
see the code ..
s = g.MeasureString(array1(j) & ": " & frag_des(1, d), l1.Font)
g = Nothing
l1.Height = CInt(s.Height)
l1.Width = CInt(s.Width) + 5
l1.Text = array1(j) & ": " & frag_des(1, d)
'MsgBox(array1(j) & ": " & frag_des(1, d))
EndIf
i.e. added some "extra" width to the label and disposed previous graphics object. After that all the labels displayed properly. Your original code should have worked but that "ffffff" string wasn't displayed correctly for some reason
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.