I am using C# in WinForms to use a trackbar as follows. At the beginning of the code I define the event handler:
this.trackBar1.Scroll += new System.EventHandler(