private void Create() { try { sqlconn = new SqlConnection(constr); sqlconn.Open(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } //전체화면 캡처와 픽처박스 사이즈 조절 screen_capture(); pictureBox1.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); pictureBox1.SendToBack(); DoubleBuffered = true; // 이중버퍼 this.KeyPreview = true; itemSelecter = new ItemSelecter(); ladder = new PictureBox(); ladder.ImageLocation = "curcor/ladder.png"; ladder.Size = new Size(100, 1000); ladder.SizeMode = PictureBoxSizeMode.StretchImage; login login = new login(); login.ShowDialog(); user_id = login.user_id; for (int i = 0; i < (int)Items_List.Ladder + 1; i++) { using (SqlConnection conn = new SqlConnection(constr)) { conn.Open(); string query = " select IMAGE from Items where ITEM_ID =" + i; SqlDataAdapter sda = new SqlDataAdapter(query, conn); SqlCommand cmd = new SqlCommand(query, conn); cmd.Connection = conn; object scalarValue = cmd.ExecuteScalar(); cursorimgpath.Add(scalarValue.ToString().Trim()); } } MouseCursor.ImageLocation = cursorimgpath[(int)Items_List.Minigun]; MouseCursor.SizeMode = PictureBoxSizeMode.StretchImage; }
/// <summary> /// 初始化目标选择 /// </summary> void Start() { // 创建单例 Single = this; }