FarPoint.Web.Spread 名前空間 > ButtonCellType クラス : GetEditorControl メソッド |
Spread コンポーネントは、エディタ コントロールによってセル全体を扱うため、常に GetEditorControl メソッドから返されたエディタ コントロールを配置します。
private void Page_Load(object sender, System.EventArgs e) { btnTypemybtn = new btnType(); FpSpread1.ActiveSheetView.Cells[0, 0].CellType = mybtn; } [Serializable()] class btnType : FarPoint.Web.Spread.ButtonCellType { public override Control GetEditorControl(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset margin, object v, bool ul) { return base.GetEditorControl(id, parent, style, margin, v, ul); } public override ControlPaintCell(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset margin, object v, bool ul) { return base.PaintCell(id, parent, style, margin, v, ul); } }
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mybtn As New btnType() FpSpread1.ActiveSheetView.Cells(0, 0).CellType = mybtn End Sub <Serializable()> _ Public Class btnType Inherits FarPoint.Web.Spread.ButtonCellType Public Overrides Function GetEditorControl(ByVal id As String, ByVal parent As TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal val As Object, ByVal ul As Boolean) As System.Web.UI.Control Return MyBase.GetEditorControl(id, parent, style, margin, val, ul) End Function Public Overrides FunctionPaintCell(ByVal id As String, ByVal parent As TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal val As Object, ByVal ul As Boolean) As System.Web.UI.Control Return MyBase.PaintCell(id, parent, style, margin, val, ul) End Function End Class