Databinding to a ToolStripStatusLabel
Hi,
Why there is no databindings for ToolStripStatusLabel? I need to add a databinding to it, like a regular label allows databinding for its text. I know StatusStrip can be databinded, but I cannot use this solution (I need a StatusStrip with 3 labels, each of them databinded to different properties).
Regards,
Valentin Iliescu
This solution is useful to my project and I have implemented it in VB as below but, although I have matched the property signatures I am still getting these errors:
"Error 1 Class 'BindableToolStripStatusLabel' must implement 'Property BindingContext() As BindingContext' for interface 'System.Windows.Forms.IBindableComponent'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers. "
"Error 2 Class 'BindableToolStripStatusLabel' must implement 'ReadOnly Property DataBindings() As ControlBindingsCollection' for interface 'System.Windows.Forms.IBindableComponent'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers."
What am I doing wrong?
Public Class BindableToolStripStatusLabel
Inherits ToolStripStatusLabel
Implements IBindableComponent
Private _context As BindingContext = Nothing
Private _bindings As ControlBindingsCollection
Public Property BindingContext() As BindingContext
Get
If Nothing Is _context Then
_context = New BindingContext()
End If
Return _context
End Get
Set(ByVal value As BindingContext)
_context = value
End Set
End Property
Public ReadOnly Property DataBindings() As ControlBindingsCollection
Get
If _bindings Is Nothing Then
_bindings = New ControlBindingsCollection(Me)
End If
Return _bindings
End Get
End Property
End Class