/// <summary> /// Set up the hidden form. /// </summary> /// <param name="detector">DriveDetector object which will receive notification about USB drives, see WndProc</param> public DetectorForm(DriveDetector detector) { mDetector = detector; this.MinimizeBox = false; this.MaximizeBox = false; this.ShowInTaskbar = false; this.ShowIcon = false; this.FormBorderStyle = FormBorderStyle.None; this.Load += new System.EventHandler(this.Load_Form); this.Activated += new EventHandler(this.Form_Activated); }
public ItemsViewer() { InitializeComponent(); GetDriveInfo(cbDrive); history.Clear(); Dolinay.DriveDetector driveDetector = new Dolinay.DriveDetector(); driveDetector.DeviceArrived += new DriveDetectorEventHandler(OnDriveArrived); driveDetector.DeviceRemoved += new DriveDetectorEventHandler(OnDriveRemoved); }
/// <summary> /// Set up the hidden form. /// </summary> /// <param name="detector">DriveDetector object which will receive notification about USB drives, see WndProc</param> public DetectorForm(DriveDetector detector) { mDetector = detector; Size = new System.Drawing.Size(5, 5); BackColor = System.Drawing.Color.Black; WindowState = FormWindowState.Minimized; ShowInTaskbar = false; // NOTA: Se anula parte del código (en especial los eventos) porque por alguna razón al ejecutar un form que // utilice esta clase, a veces, el form abierto pierde el foco en favor de otras aplicaciones abiertas // en Windows. Ej: Al ejecutar ProgramadorCS sube arriba Google Chrome //this.MinimizeBox = false; //this.MaximizeBox = false; //this.ShowIcon = false; //this.FormBorderStyle = FormBorderStyle.None; //this.Load += new System.EventHandler(this.Load_Form); //this.Activated += new EventHandler(this.Form_Activated); }