private void ScanFingerStdFrm_Load(object sender, EventArgs e) { // Init Database _db = ((TeachingViewFrm)Parent)._db; // Init FP engine _fpEngine = new AxZKFPEngX(); _fpEngine.BeginInit(); _fpEngine.OnEnroll += new IZKFPEngXEvents_OnEnrollEventHandler(_fpEngine_OnEnroll); _fpEngine.OnImageReceived += new IZKFPEngXEvents_OnImageReceivedEventHandler(_fpEngine_OnImageReceived); this.Controls.Add(_fpEngine); if (_fpEngine.InitEngine() != 0) { MessageBox.Show("ไม่สามารถติดต่อเครื่องสแกนลายนิ้วมือได้", "", MessageBoxButtons.OK, MessageBoxIcon.Error); if (AutoScanMode == false) { this.Close(); } else { _fpEngine.EndInit(); _fpEngine.EndEngine(); StopAutoScan = true; btnCancel.Enabled = false; } } _fpEngine.BeginEnroll(); txtFPStatus.Text = "วางนิ้ว 3 ครั้ง"; txtFPNo.Text = _cntFPEnroll.ToString(); _timer.Enabled = false; _timer.Interval = 3000; _timer.Tick += new EventHandler(_timer_Tick); txtStdID.Text = StdID; txtStdName.Text = StdName; if (AutoScanMode == false) { btnStop.Visible = false; btnCancel.Visible = false; } }