コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     mapPosition.scale         = (float)nodeScale.Value;
     mapPosition.numberPortion = (int)numberPortion.Value;
     mapPosition.letterPortion = letterPortion.Text;
     nodeButton.SetPosition(new Point((int)xPositon.Value + CENTER_OFFSET, (int)yPosition.Value));
     Close();
 }
コード例 #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (currentState == MapState.ADD || currentState == MapState.MOVING)
     {
         currentNode.SetPosition(new Point(MousePosition.X - Bounds.Location.X - 10 - mapArea.Bounds.Location.X - panel1.Location.X - groupBox2.Location.X - tabControl1.Location.X - currentNode.Width / 2, MousePosition.Y - Bounds.Location.Y - 70 - mapArea.Bounds.Location.Y - panel1.Location.Y - groupBox2.Location.Y - tabControl1.Location.Y + currentNode.Height / 2));
     }
     if (currentState == MapState.ADD_GATE || currentState == MapState.MOVING_GATE)
     {
         currentGate.SetPosition(new Point(MousePosition.X - Bounds.Location.X - 10 - mapArea.Bounds.Location.X - panel1.Location.X - groupBox2.Location.X - tabControl1.Location.X - currentGate.Width / 2, MousePosition.Y - Bounds.Location.Y - 70 - mapArea.Bounds.Location.Y - panel1.Location.Y - groupBox2.Location.Y - tabControl1.Location.Y + currentGate.Height / 2));
     }
     if (currentState == MapState.MOVING)
     {
         mapArea.Refresh();
     }
 }