Listbox index to 2D index

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2008
Posts: 23
Reputation: 3Dees is an unknown quantity at this point 
Solved Threads: 0
3Dees 3Dees is offline Offline
Newbie Poster

Listbox index to 2D index

 
0
  #1
Nov 10th, 2008
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??
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC