private void btnGiven_Click(object sender, EventArgs e) { int a, b; if (int.TryParse(tbxX.Text, out a)) if (int.TryParse(tbxY.Text, out b)) { Utils.Coordinates givenXY = new Utils.Coordinates(a, b); lbxOutput.Items.Add(givenXY.ToString()); } }
private void moveClick(object sender, EventArgs e) { Button btn = sender as Button; //Tag values have ; as separator string btb_tag = btn.Tag.ToString(); string[] parts = btb_tag.Split(';'); if (parts.Length != 2) { MessageBox.Show("Tag value in button is incorrect"); } else { int x = int.Parse(parts[0]); int y = int.Parse(parts[1]); Utils.Coordinates movedCoords = new Utils.Coordinates(x, y); sf.Pict.Move(movedCoords); //PbxOutput property was created to get Invalidate() visible too sf.PbxOutput.Invalidate(); } }
private void btnDefault_Click(object sender, EventArgs e) { Utils.Coordinates defXY = new Utils.Coordinates(); lbxOutput.Items.Add(defXY.ToString()); }