943,840 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 1255
  • VB.NET RSS
Nov 10th, 2008
0

Listbox index to 2D index

Expand Post »
Hi,
i have bieng trying to write a method which takes a listbox index (1D array) and find the corresponding 2D index. I did this code with some help which get the 1D index of a 2D array. Now i need to do the reverse from listbox index (1D) and get the corresponding 2D index (row, col).

Public Function MatrixIndexToVector(ByVal row As Integer, ByVal col As Integer) As Integer

ReDim temp(row, col)
Dim index As Integer

For row = 0 To temp.GetUpperBound(0)
For col = 0 To temp.GetUpperBound(0) - 1

temp(row, col) = index
index += 1
Next col
Next row
Return index
End Function

pointers??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
3Dees is offline Offline
23 posts
since Sep 2008

This thread is solved

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.
Message:
Previous Thread in VB.NET Forum Timeline: vb.net Fill function
Next Thread in VB.NET Forum Timeline: How to define a UserControl





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC