public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
fpSpread1.ActiveSheet.Cells[1, 1].CellType = new CustomCellType();
}
}
[Serializable()]
class CustomCellType : FarPoint.Win.Spread.CellType.GeneralCellType
{
TextBox textBox1 = new TextBox();
public override Control GetEditorControl(FarPoint.Win.Spread.Appearance appearance, float zoomFactor)
{
return textBox1;
}
public override object GetEditorValue()
{
return textBox1.Text;
}
public override void SetEditorValue(object value)
{
textBox1.Text = "abc";
// 編集用コントロールのModifiedをTrue にします
textBox1.Modified = true;
}
}
<Serializable()> Public Class CustomCellType
Inherits FarPoint.Win.Spread.CellType.GeneralCellType
Private textBox1 As New TextBox
Public Overrides Function GetEditorControl(ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal zoomFactor As Single) As System.Windows.Forms.Control
Return textBox1
End Function
Public Overrides Function GetEditorValue() As Object
Return textBox1.Text
End Function
Public Overrides Sub SetEditorValue(ByVal value As Object)
textBox1.Text = "abc"
' 編集用コントロールのModifiedをTrue にします
textBox1.Modified = True
End Sub
End Class