回复 4楼deppp的帖子
以下代码和你的需求最接近,不过还是会在单击单元格时显示下拉框:
- Public Class Form1
- Dim txtList As New List(Of String)
- Dim dataList As New List(Of String)
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- Dim tempEditor As New FarPoint.Win.Spread.CellType.ComboBoxCellType
- For jCount = 0 To 4
- txtList.Add(jCount.ToString & "aaa")
- dataList.Add(jCount.ToString & "000")
- Next jCount
- tempEditor.Items = txtList.ToArray()
- tempEditor.ItemData = dataList.ToArray()
- tempEditor.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData
- FpSpread1.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentCell
- FpSpread1.ActiveSheet.Columns(1).CellType = tempEditor
- End Sub
- Private Sub 取值ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 取值ToolStripMenuItem.Click
- MsgBox(FpSpread1.ActiveSheet.ActiveCell.Text)
- End Sub
- Private Sub 取ValueToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 取ValueToolStripMenuItem.Click
- MsgBox(FpSpread1.ActiveSheet.ActiveCell.Value)
- End Sub
- End Class
复制代码 |