Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27379

VS 2010 value of type 'integer' not being moved to array of texts

$
0
0
I am trying to move value of cells of a datagridview to an array of textboxes. The code is like this.
Const col As Integer = 8
Const row As Integer = 12

For n = 0 To col
txtFigure(row, col) = New TextBox
txtFigure(row, col).Font = objFont

txtFigure(row, col).Left = n * txtFigure(row, col).Width + txtFigure(row, col).Left + fromLeft
txtFigure(row, col).Top = i * txtFigure(row, col).Height + txtFigure(row, col).Top + fromTop
Controls.Add(txtFigure(row, col))
txtFigure(row, col).Text = 0

Next
For i = 1 To 11
mAmt = (dgActuals.Rows(xRow).Cells(xColumn).Value)
If Not mAmt = 0 Then
txtFigure(i, 0).Text = mAmt
xColumn += 1
End If
Next i

The txtfigure(i,0).text has the type of text box.

the value of mAmt is non zero integer. I've tried convert.tostring(mamt) and mamt.tostring but the message is

System.NullReferenceException was unhandled

HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=SOME Project

Viewing all articles
Browse latest Browse all 27379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>