C# Use 'this' Keyword in a class : <p>i have a code for creating a LineShape from two points .</p>

<pre><code>class MyMenu
{
    public static void AddLine()
    {

        ShapeContainer canvas = new ShapeContainer();
        LineShape theLine = new LineShape();

        canvas.Parent = this;

        theLine.Parent = canvas;
        theLine.BorderColor = SystemColors.ControlDarkDark;

        theLine.StartPoint = new System.Drawing.Point(-3, 154);
        theLine.EndPoint = new System.Drawing.Point(212, 154);

    }
}
</code></pre>

<p>. i want to create a class and use from there but i end up having an error .</p>

<pre><code>Keyword 'this' is not valid in a static property, static method, or static field initializer    
</code></pre>

<p>i tried to fix it like this but nothing !</p>

<pre><code> Form1 MyForm = new Form1();
        canvas.Parent = MyForm;
</code></pre>

<p>Thanks you !</p>
