t.alkathiri 0 Newbie Poster

Dear all Members
I am trying to customize the default binding navigator as i inherit it to my own class and add some buttons to it.
every thing gos fine and great as i want it, but the problem is when i change any thing in the AddStandardItems() method class dos not reflect to the existing form which has the same class, i have to remove it from the form and put it again to reflect the changes.
This is not good solution, i have more than 30 forms using the same Binding navigator class and it is not possible to remove it form all those forms and put it again.
the code for the class is:

Public Class Bind2
    Inherits BindingNavigator
    Private WithEvents DtEditButton As ToolStripItem = Nothing
    Public Sub New()
        MyBase.New()
    End Sub

    Public Property EditItem() As ToolStripItem
        Get
            Return DtEditButton
        End Get
        Set(ByVal value As ToolStripItem)
            DtEditButton = value
        End Set
    End Property

    Public Overrides Sub AddStandardItems()
        MyBase.AddStandardItems()

        Dim Seprator As New ToolStripSeparator()

        Me.DtEditButton = New ToolStripButton("Edit")
        Me.DtEditButton.Name = "BindingNavigatorButtonEdit"
        Me.DtEditButton.Image = My.Resources.SaveHL
        Me.DtEditButton.DisplayStyle = ToolStripItemDisplayStyle.Image
        Me.Items.Add(Me.DtEditButton)
        Me.Items.Add(Seprator)
    End Sub
End Class

Best Regards
Tarik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.