| | |
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: How to define a UserControl
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists forms function html images isnumericfuntioncall lib listview map mobile module msaccess mssqlbackend mysql net number open page pan pdf picturebox picturebox2 port print printing printpreview problem record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure structures temp textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winsock wpf wrapingcode xml





