Home > Software engineering >  MSHFlexGrid display problems
MSHFlexGrid display problems

Time:09-20

MSHFlexGrid shows that there is a problem, can only show the last line, text display is normal, the ROW assignment problem is suspected, but don't know how to change, the code is as follows:
 Private Sub Print_Array (Arrays () As a Double, the Title As a String) 'print array 
Dim I As an Integer, k As Long, n As Long, j As Integer
Dim da As Double
K=UBound (Arrays)
For I=0 To k
J=n
Da=Arrays (k) - Arrays (0)
Form2. Text1. Text=form2. Text1. Text & amp; The Format (Arrays (I) + da, "0.0000") & amp; ", "
Next I
'Dim n As Long
'Dim As Integer I write grid position variable
'Dim j As Integer
On Error GoTo e:
I=1
Dim Col As Integer
Dim Row As Integer
The Row=1
N=n + 1
N=UBound (Arrays)
If the Row & gt; Form2. MSHFlexGrid1. Then Rows - 1 'was insufficient when importing data, table row number automatically add
Form2. MSHFlexGrid1. Rows=Row + 1
End the If
If n & gt; Form2. MSHFlexGrid1. Then Cols - 1
Form2. MSHFlexGrid1. Cols=n + 2
End the If
For I=0 To n
With form2. MSHFlexGrid1
TextMatrix (0, I + 1)="" & amp; I + 1
TextMatrix (Row, 0)="" & amp; The Row
ColAlignment (I + 1)=1 'flexAlignCenterCenter
The Row=Row
. The Col=I + 1 'color limit
. CellForeColor=& amp; H0 & amp; 'the color of the text is black
TextMatrix (Row, "I + 1)=Format (Arrays (I) + da," 0.0000 ")
End With
Next
The Row Row + 1=
Close # 1
E: If Err Then
If Not StrComp (Err) Description, "selected" cancel ", ") Then the Exit Sub
End the If
'set the header to black
For j=0 To 1
With form2. MSHFlexGrid1
. The Row=0
Col=j 'color limit
. CellForeColor=& amp; H0 & amp; 'the color of the text is black
End With
Next j
Form2. Enabled=True

End Sub

CodePudding user response:

CodePudding user response:

 form2. MSHFlexGrid1. Height=(form2. MSHFlexGrid1. Rows + 1) * 17 * 15 

CodePudding user response:

Problem not on the width, but the Rows only set to two lines,

Suggestions on the basis of Rows=1 configuration header, then add record row AddItem method,
  • Related