Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display an Array on a Form

Status
Not open for further replies.

zdas04

Technical User
Sep 9, 2003
29
0
0
US
I've got a two-dimensional array of physical properties (i.e. AnalysisConstant(0,0) is Methane Molecular Weight, (0,1) is Methane Specific Gravity, (1,0) is Ethane Molecular Weight, etc.) that I'm trying to display on a form. My first thought was to define 105 text boxes and use something like:

Dim i as Integer
Dim j as Integer
Dim k as Integer

for j = 0 to 6
for i = 0 to 14
k = (j * 14) + i + 1
TextBox[k] = AnalysisConstant(i,j)
next i
next j

Of course this doesn't work. Is there some sort of other construct that would do this easily?

I know that in this case I could make one text box multi-line and build a string with imbedded vbCrLf commands that could simulate a table, but I have two other arrays for user input that won't work within strings.

I thought the DataGrid construct would work, but I can't figure out how to set the number of columns/rows in a DataGrid.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top