#pragma once
#include "Global.h"
#include "BaseFormControl.h"

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace ObjDataEdit
{
	/// <summary> 
	/// Summary for CopyObjForm
	///
	/// WARNING: If you change the name of this class, you will need to change the 
	///          'Resource File Name' property for the managed resource compiler tool 
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public __gc class CopyObjForm : public System::Windows::Forms::Form
	{
	public: 
		CopyObjForm( SearchFormTypeENUM  FormType , char* DBName )
		{
			InitializeComponent();
            _IsAccept = false;
			_FormType = FormType;
			_DBName = DBName;
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
    private: System::Windows::Forms::Button *  button2;
    private: System::Windows::Forms::Button *  button1;
			 System::ComponentModel::Container* components;
			 System::Windows::Forms::Label*  label1;
	private: System::Windows::Forms::TextBox*  TB_SelectID;


	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
			 bool    _IsAccept;
			 SearchFormTypeENUM  _FormType;
			 int	 _SelectID;
			 char*	 _DBName;

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->button2 = (new System::Windows::Forms::Button());
			this->button1 = (new System::Windows::Forms::Button());
			this->label1 = (new System::Windows::Forms::Label());
			this->TB_SelectID = (new System::Windows::Forms::TextBox());
			this->SuspendLayout();
			// 
			// button2
			// 
			this->button2->DialogResult = System::Windows::Forms::DialogResult::Cancel;
			this->button2->Location = System::Drawing::Point(102, 40);
			this->button2->Name = S"button2";
			this->button2->Size = System::Drawing::Size(75, 24);
			this->button2->TabIndex = 7;
			this->button2->Text = S"取消";
			this->button2->Click += new System::EventHandler(this, &CopyObjForm::Cancel_Click);
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(14, 40);
			this->button1->Name = S"button1";
			this->button1->Size = System::Drawing::Size(75, 24);
			this->button1->TabIndex = 6;
			this->button1->Text = S"確定";
			this->button1->Click += new System::EventHandler(this, &CopyObjForm::Ok_Click);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(12, 15);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(53, 12);
			this->label1->TabIndex = 9;
			this->label1->Text = S"拷貝來源";
			// 
			// TB_SelectID
			// 
			this->TB_SelectID->Location = System::Drawing::Point(71, 12);
			this->TB_SelectID->Name = S"TB_SelectID";
			this->TB_SelectID->Size = System::Drawing::Size(100, 22);
			this->TB_SelectID->TabIndex = 10;
			this->TB_SelectID->DoubleClick += new System::EventHandler(this, &CopyObjForm::TB_SelectID_DoubleClick);
			this->TB_SelectID->TextChanged += new System::EventHandler(this, &CopyObjForm::TB_SelectID_TextChanged);
			this->TB_SelectID->KeyDown += new System::Windows::Forms::KeyEventHandler(this, &CopyObjForm::TB_SelectID_KeyDown);
			// 
			// CopyObjForm
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(5, 15);
			this->ClientSize = System::Drawing::Size(199, 77);
			this->Controls->Add(this->TB_SelectID);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Name = S"CopyObjForm";
			this->Text = S"CopyObjForm";
			this->ResumeLayout(false);
			this->PerformLayout();

		}		


    private: System::Void Cancel_Click(System::Object *  sender, System::EventArgs *  e)
             {
                 Close();
             }

    private: System::Void Ok_Click(System::Object *  sender, System::EventArgs *  e)
             {
                 _IsAccept = true;
                 Close();
             }


    public:
        bool    IsAccept(){ return _IsAccept; }
		int		SelectID(){ return _SelectID; }
		
	private: System::Void TB_SelectID_DoubleClick(System::Object*  sender, System::EventArgs*  e) ;
	private: System::Void TB_SelectID_TextChanged(System::Object*  sender, System::EventArgs*  e);
	private: System::Void TB_SelectID_KeyDown(System::Object*  sender, System::Windows::Forms::KeyEventArgs*  e) 
		 {
			//如果按下Enter
			if( e->KeyValue == 13 )
			{
				_IsAccept = true;
				Close();
			}
		 }
};
}