可以尝试使用下面的代码:
- Public Class MyCombo
- Inherits FarPoint.Win.Spread.CellType.ComboBoxCellType
- Public Overrides Function GetEditorControl(ByVal parent As System.Windows.Forms.Control, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal zoomFactor As Single) As System.Windows.Forms.Control
- Dim editor As FarPoint.Win.FpCombo = MyBase.GetEditorControl(parent, appearance, zoomFactor)
- editor.ButtonStyle = FarPoint.Win.ButtonStyle.None
- Return editor
- End Function
- End Class
复制代码
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim mycmb As New MyCombo
- mycmb.Items = New String() {"AA", "BB"}
- FpSpread1.ActiveSheet.Columns(1).Editor = mycmb
- End Sub
复制代码 |