private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     // Clean up the objects.
     DIDI8 = null;
     DI8   = null;
     DX8   = null;
 }
        private DirectInputDeviceInstance8 DIDI8; //DirectInput 8 Device

        private void frmMain_Load(object sender, System.EventArgs e)
        {
            //Initialize the DirectX objects.
            DX8 = new DirectX8Class();
            DI8 = DX8.DirectInputCreate();
        }