Public Class SpreadTextBox
Inherits TextBox
Implements FarPoint.Win.Spread.DrawingSpace.IEmbeddedControlSupport
Private moving As FarPoint.Win.Spread.DrawingSpace.Moving = FarPoint.Win.Spread.DrawingSpace.Moving.None
Private sizing As FarPoint.Win.Spread.DrawingSpace.Sizing = FarPoint.Win.Spread.DrawingSpace.Sizing.None
Private activation As FarPoint.Win.Spread.DrawingSpace.ChildActivationPolicy = FarPoint.Win.Spread.DrawingSpace.ChildActivationPolicy.DoubleClick
Public Overridable Property ActivationPolicy() As FarPoint.Win.Spread.DrawingSpace.ChildActivationPolicy Implements FarPoint.Win.Spread.DrawingSpace.IEmbeddedControlSupport.ActivationPolicy
Get
Return activation
End Get
Set(ByVal Value As FarPoint.Win.Spread.DrawingSpace.ChildActivationPolicy)
' activation = Value
End Set
End Property
Public Overridable Property CanMove() As FarPoint.Win.Spread.DrawingSpace.Moving Implements FarPoint.Win.Spread.DrawingSpace.IEmbeddedControlSupport.CanMove
Get
Return moving
End Get
Set(ByVal Value As FarPoint.Win.Spread.DrawingSpace.Moving)
moving = Value
End Set
End Property
Public Overridable Property CanSize() As FarPoint.Win.Spread.DrawingSpace.Sizing Implements FarPoint.Win.Spread.DrawingSpace.IEmbeddedControlSupport.CanSize
Get
Return sizing
End Get
Set(ByVal Value As FarPoint.Win.Spread.DrawingSpace.Sizing)
sizing = Value
End Set
End Property
Public Sub ControlPaint(ByVal g As Graphics, ByVal r As Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance,
ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single) Implements FarPoint.Win.Spread.DrawingSpace.IEmbeddedControlSupport.ControlPaint
g.SetClip(r, Drawing2D.CombineMode.Intersect)
g.FillRectangle(New SolidBrush(Me.BackColor), r)
'g.FillRectangle(New SolidBrush(Me.BackColor), r.X - 120, r.Y - 120, r.Width, r.Height)
g.DrawString(Me.Text, Font, New SolidBrush(Me.ForeColor), r.X, r.Y)
AddHandler Me.TextChanged, AddressOf MeTextChanged
End Sub
Public Sub MeTextChanged(ByVal sender As Object, ByVal e As EventArgs)
Me.BackColor = Color.Beige
End Sub
End Class
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim tb As New SpreadTextBox()
tb.Name = "TB"
fpSpread1.AddControl(tb, 0)
'fpSpread1.AddControl(tb, 0, 1, 1)
End Sub