A
Andrei Pociu
Inside a method some controls are created at runtime.
I added an event handler to one of these controls:
tracker.Scroll += new System.EventHandler(this.tracker_Scroll);
So in the event handler I used unboxing to get access to the value of the
TrackBar:
private void tracker_Scroll(object sender, System.EventArgs e)
{
TrackBar currTrack = (TrackBar)sender;
MessageBox.Show(currTrack.Value.ToString());
}
It works fine, but inside the event handler I also want to change the
property of another control created at runtime (set a TextBox to the value
of the TrackBar).
My question is, of course, how do I do that, how do I get access to the
TextBox created at runtime?
Thank you.
I added an event handler to one of these controls:
tracker.Scroll += new System.EventHandler(this.tracker_Scroll);
So in the event handler I used unboxing to get access to the value of the
TrackBar:
private void tracker_Scroll(object sender, System.EventArgs e)
{
TrackBar currTrack = (TrackBar)sender;
MessageBox.Show(currTrack.Value.ToString());
}
It works fine, but inside the event handler I also want to change the
property of another control created at runtime (set a TextBox to the value
of the TrackBar).
My question is, of course, how do I do that, how do I get access to the
TextBox created at runtime?
Thank you.