Checking the TrackBarSrv.cs File
Following is the full source code for the TrackBarSrv class. Check that the contents of your TrackBarSrv.cs file is similar to the one illustrated below.
using System; using Mercury.QTP.CustomServer; namespace UFTCustServer { [ReplayInterface] public interface ITrackBarSrvReplay { void SetValue(int newValue); } public class TrackBarSrv: CustomServerBase, ITrackBarSrvReplay { public TrackBarSrv() { } public override void InitEventListener() { Delegate e = new System.EventHandler(this.OnValueChanged); AddHandler("ValueChanged", e); } public override void ReleaseEventListener() { } public void OnValueChanged(object sender, EventArgs e) { System.Windows.Forms.TrackBar trackBar = (System.Windows.Forms.TrackBar)sender; int newValue = trackBar.Value; RecordFunction("SetValue", RecordingMode.RECORD_SEND_LINE, newValue); } public void SetValue(int newValue) { System.Windows.Forms.TrackBar trackBar = (System.Windows.Forms.TrackBar)SourceControl; trackBar.Value = newValue; } } }