| | |
Listbox index to 2D index
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 23
Reputation:
Solved Threads: 0
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??
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
- Listbox in Tkinter python (Python)
- Controlling GridView with a ListBox(multible selections enabled) (ASP.NET)
- add to combobox from listbox in another form (Visual Basic 4 / 5 / 6)
- Saving information from .NET Listbox into SQL Server 2000 (ASP.NET)
- Listbox Items as an array (ASP.NET)
- Any way to refresh textfield content? (Graphics and Multimedia)
- Listbox selectedItem.value cannot be retrieved (ASP.NET)
- link text boxes with listbox (VB.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: vb.net Fill function
- Next Thread: Crystal Reports asks for Username and Password while loading
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





