Пример #1
0
        private void _layoutPiece_ForceRedraw(object sender, MyPictureBoxEventArgs e)
        {
            //get layout stats
            TileContainerStats attribs = e.Attributes;

            //remove current control from layout panel
            attribs.LayoutPanel.Controls.Remove((Control)sender);
            //make a new panel (automatically adds to appropriate panel)
            MakePane(attribs.I, attribs.J, attribs.X, attribs.Y, attribs.Container, attribs.LayoutPanel);
            //cast sender as a control
            Control c = (Control)sender;

            //dispose of sender
            c.Dispose();
        }
 private void _layoutPiece_ForceRedraw(object sender, MyPictureBoxEventArgs e)
 {
     //get layout stats
     TileContainerStats attribs = e.Attributes;
     //remove current control from layout panel
     attribs.LayoutPanel.Controls.Remove((Control)sender);
     //make a new panel (automatically adds to appropriate panel)
     MakePane(attribs.I,attribs.J,attribs.X,attribs.Y,attribs.Container,attribs.LayoutPanel);
     //cast sender as a control
     Control c = (Control)sender;
     //dispose of sender
     c.Dispose();
 }