S
Syed Zaidi via .NET 247
I am working on a small project in which i want to develop acustom toolbar skeleton for handling database navigation. I havecreated a usercontrol consist of a toolbar inherits fromusercontrol and winform holding that control. First I want toaccess the Click functionality of each toolbar button(usercontrol) in my winform which holding the usercontrol; secondlywants to override the methods of usercontrol in winformaccordingly to the click event of toolbar buttons from winform.
User Control Class
Public Class TBSDbAccess
Inherits System.Windows.Forms.UserControl
'Implements ControlAccess
Public Sub tlbDbAccess_ButtonClick(ByVal sender AsSystem.Object, ByVal e AsSystem.Windows.Forms.ToolBarButtonClickEventArgs)
Select Case tlbDbAccess.Buttons.IndexOf(e.Button)
Case 0 'First Record
MsgBox("0")
FirstRecord()
End Select
End Sub
Public Overridable Sub FirstRecord()
End Sub
User Control Class
Public Class TBSDbAccess
Inherits System.Windows.Forms.UserControl
'Implements ControlAccess
Public Sub tlbDbAccess_ButtonClick(ByVal sender AsSystem.Object, ByVal e AsSystem.Windows.Forms.ToolBarButtonClickEventArgs)
Select Case tlbDbAccess.Buttons.IndexOf(e.Button)
Case 0 'First Record
MsgBox("0")
FirstRecord()
End Select
End Sub
Public Overridable Sub FirstRecord()
End Sub