title: How to make a reference to a struct in C#
body: <p>in my application I have a LineShape control and a custom control (essentially a PictureBox with Label).</p>
  
  <p>I want the LineShape to change one of its points coordinates, according to location of the custom control. </p>
  
  <p>I had an idea to set a reference to a LineShape point inside the custom control and add location change event handler that changes referenced point coordinates. </p>
  
  <p>However built in Point is a struct which is a value type, so that won't work. Does anyone have idea, how to make a reference to a structure or maybe someone knows a workaround for my problem?</p>
  
  <p>I tried the solution regarding usage of the nullable type but it still doesn't work. Here's the way I define the field in my custom control (DeviceControl):</p>
  
  <pre><code>private Point? mConnectionPoint;
  </code></pre>
  
  <p>And implementation of the location change event handler:</p>
  
  <pre><code>private void DeviceControl_LocationChanged(object sender, EventArgs e)
  {
      if (mConnectionPoint != null)
      {
          DeviceControl control = (DeviceControl)sender;
  
          Point centerPoint= new Point();
          centerPoint.X = control.Location.X + control.Width / 2;
          centerPoint.Y = control.Location.Y + control.Height / 2;
  
          mConnectionPoint = centerPoint;
      }
  }
  </code></pre>