title: How can i pass a variable from windows forms project to a dll project?
body: <p>In a solution i have two projects one is dll project and thr second is windows forms.
  In the windows forms project in form1 i can call methods from the dll project for example:</p>
  
  <p>In form1 top:</p>
  
  <pre><code>Capture.Hook.DX11.DXOverlayEngine overlayengine;
  </code></pre>
  
  <p>In constructor:</p>
  
  <pre><code>overlayengine = new Capture.Hook.DX11.DXOverlayEngine();
  </code></pre>
  
  <p>And then in the constructor i can make:</p>
  
  <pre><code>overlayengine.Draw();
  </code></pre>
  
  <p>In the project dll in the Draw() method there are two lines that draw:</p>
  
  <pre><code>_spriteEngine.DrawString(textElement.Location.X + 1800, textElement.Location.Y, textElement.Text, textElement.Color.R, textElement.Color.G, textElement.Color.B, textElement.Color.A, font);
                              _spriteEngine.DrawString(textElement.Location.X + 1800, textElement.Location.Y + 25,
                                                DateTime.Now.ToString("h:mm tt"),textElement.Color.R, textElement.Color.G, textElement.Color.B, textElement.Color.A, font);
  </code></pre>
  
  <p>This is what i did now:</p>
  
  <p>In the dll project(library type project) i added in top:</p>
  
  <pre><code>public bool DrawEnabled { get; set; }
  </code></pre>
  
  <p>Then inside the Draw() method i did:</p>
  
  <pre><code>if (DrawEnabled == true)
                              {
                                  _spriteEngine.DrawString(textElement.Location.X + 1800, textElement.Location.Y, textElement.Text, textElement.Color.R, textElement.Color.G, textElement.Color.B, textElement.Color.A, font);
                                  _spriteEngine.DrawString(textElement.Location.X + 1800, textElement.Location.Y + 25,
                                                    DateTime.Now.ToString("h:mm tt"), textElement.Color.R, textElement.Color.G, textElement.Color.B, textElement.Color.A, font);
                              }
  </code></pre>
  
  <p>Then in form1 i did at top:</p>
  
  <pre><code>Capture.Hook.DX11.DXOverlayEngine overlayengine;
  </code></pre>
  
  <p>Then in form1 constructor:</p>
  
  <pre><code>overlayengine = new Capture.Hook.DX11.DXOverlayEngine();
  overlayengine.DrawEnabled = false;
  </code></pre>
  
  <p>Then in a button click event in form1 i did:</p>
  
  <pre><code>void gkh_KeyDown(object sender, KeyEventArgs e)
          {
              overlayengine.DrawEnabled = true;
          }
  </code></pre>
  
  <p>I used a breakpoint and it's getting and doing overlayengine.DrawEnabled = true; but i don't see the drawings anywhere when i press the key. </p>
  
  <p>what's wrong ?</p>