title: Accessing form variables from user control in C#
body: <p>I have an application that consists of several forms. There is a MainForm and then other forms open up within this MainForm. One of the child forms that opens up (we'll just call it Form1) contains a user control that has controls inside it, such as a datagrid view. This datagridview control has several events that are triggered, one being a "cellclick" event.</p>
  
  <p>This click event must access a public timer object that is declared in Form1. </p>
  
  <p>Currently just to make it work I used the code:</p>
  
  <pre><code>((Form1)this.Parent.Parent.Parent.Parent.Parent).clickTimer.Start();
  </code></pre>
  
  <p>However this doesn't seem like the best way I could be accessing this Timer object, and could potentially be a headache for future development of Form1 and its User Controls.</p>
  
  <p>What are alternative ways of accessing my Form1 timer from inside the user control's datagridview click event? </p>
  
  <p>Any advice is appreciated as I'm drawing a blank on this right now.</p>
  
  <p>Thanks</p>