新建一个工程,在FROM上加一个 Spread 控件,from中的代码如下(使用3J的场合是好的,5J的时候就会报错):
Imports FarPoint.Win.Spread
Imports FarPoint.Win.Spread.CellType
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s(100) As String
For i As Integer = 0 To Me.FpSpread1.ActiveSheet.RowCount - 1
For j As Integer = 0 To 100
s(j) = j
Next
DirectCast(Me.FpSpread1.ActiveSheet.Cells(i, 0).CellType, ComboBoxCellType).Items = s
Next
End Sub
Private Sub FpSpread1_ComboCloseUp(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditorNotifyEventArgs) Handles FpSpread1.ComboCloseUp
Select Case e.Column
Case 0
fncSetNippoKoumokuCode1(e.Row)
End Select
End Sub
Private Sub fncSetNippoKoumokuCode1(ByRef alngRow As Integer)
DirectCast(Me.FpSpread1.ActiveSheet.Cells(alngRow, 1).CellType, ComboBoxCellType).Items = New String() {"", "21321", "aaaa", "bbbb"}
End Sub
End Class |