Beispiel #1
0
 public void Execute(MainForm mainForm, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         MapForm mapForm = (MapForm)mainForm.ActiveMdiChild;
         int dx = (startPoint.X - e.Location.X);
         int dy = (startPoint.Y - e.Location.Y);
         mapForm.AutoScrollPosition = new Point(mapForm.HorizontalScroll.Value + dx, mapForm.VerticalScroll.Value + dy);
     }
 }
        public void Execute(MainForm mainForm, MouseEventArgs e)
        {
            MapForm mapForm = (MapForm)mainForm.ActiveMdiChild;
            MapEntity entity = new MapEntity();

            try
            {
                entity.Filename = mainForm.ActivePaletteImage();
                Image img = new Bitmap(mainForm.ActivePaletteImage());
                entity.Size = img.Size;
                entity.Location = e.Location;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            mapForm.RemoveEntity(entity.Location);
        }