I would do something like the following (syntax is not guaranteed perfect):
On you UserControl, drop four buttons, lay them out how you want, and name
one btnFirst, btnPrev, btnNext, and btnLast.
Then in the code behind code as follows (Designer generated code left out):
Public Class MyNavControl
Inherits UserControl
Public Enum MovementStep
First
Previous
Next
Last
End Enum
Public Event Navigate(WhichW ay As MovementStep)
Public Sub btnClick(sender As Object, e As EventArgs) _
Handles btnFirst.Click, btnPrev.Click, btnNext.Click, btnLast.Click
If sender Is btnFirst Then
RaiseEvent Navigate(Moveme ntStep.First)
ElseIf sender Is btnPrev Then
RaiseEvent Navigate(Moveme ntStep.Previous )
ElseIf sender Is btnNext Then
RaiseEvent Navigate(Moveme ntStep.Next)
ElseIf sender Is btnLast Then
RaiseEvent Navigate(Moveme ntStep.Last)
End If
End Sub
End Class
"Syed Zaidi" <hy**********@y ahoo.co.uk> wrote in message
news:e2******** *************** ***********@msn ews.microsoft.c om...
Hello All
I am a newbie in VB.NET and wanting to create a toolbar(User
Control) for Database Navigation. What exactly I want is to have a user
control which is inherited from the system.windows. forms. usercontrol and
contain a toolbar which have buttons for navigating records. And the
client Windows Form which owns that control must overrides the navigation
methods of user control. Forexample to add some custom functionality for
moving to first record.
Kind Regards
Syed Zaidi
From
http://www.developmentnow.com/g/38_2...nguages-vb.htm
Posted via DevelopmentNow. com Groups
http://www.developmentnow.com