private void ButtonOK_Click(object sender, EventArgs e) { results = new int[4] { (int)newLayerAlign.TopBox.Value, (int)newLayerAlign.BottomBox.Value, (int)newLayerAlign.LeftBox.Value, (int)newLayerAlign.RightBox.Value }; newLayerAlign.Dispose(); }