ShapeAdded

Top  Previous  Next

public event

 

Description:

 When add a shape, this event trigger.

 

Example:

 private void myCAD1_ShapeAdded(object sender, Codeidea.UltraGraphics.ShapeAddedEventArgs e)

 {

         //Add a image shape

         if (e.WorkingShape is MyImage == true)

         {

                 openFileDialog1.InitialDirectory = Application.ExecutablePath;

                 openFileDialog1.Filter = "BMP(*.bmp)|*.bmp|JPEG(*.jpg;*.jpe;*.jpeg)|*.jpg;*.jpe;*.jpeg|All files(*.*)|*.*";

                 if (openFileDialog1.ShowDialog() == DialogResult.OK)

                 {

                         Bitmap myBitmap = new

                         (e.WorkingShape as MyImage).Bitmap = myBitmap;

                 }

         }

 }