 
     
    Add-Type -AssemblyName System.Windows.Forms 
    Add-Type -AssemblyName System.Drawing 
    $MyForm = New-Object System.Windows.Forms.Form 
    $MyForm.Text="MyForm" 
    $MyForm.Size = New-Object System.Drawing.Size(300,300) 
     
 
        $m1 = New-Object System.Windows.Forms. 
                $m1.Text="1" 
                $m1.Top="5" 
                $m1.Left="5" 
                $m1.Anchor="Left,Top" 
        $m1.Size = New-Object System.Drawing.Size(100,23) 
        $MyForm.Controls.Add($m1) 
         
 
        $mDataGrid1 = New-Object System.Windows.Forms.DataGrid 
                $mDataGrid1.Text="DataGrid1" 
                $mDataGrid1.Top="83" 
                $mDataGrid1.Left="20" 
                $mDataGrid1.Anchor="Left,Top" 
        $mDataGrid1.Size = New-Object System.Drawing.Size(100,23) 
        $MyForm.Controls.Add($mDataGrid1) 
        $MyForm.ShowDialog()
