ShapeAdded

<< Click to Display Table of Contents >>

Navigation:  MyCAD > Events >

ShapeAdded

public event ShapeAddedEventHandler ShapeAdded;

 

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 Bitmap(openFileDialog1.FileName);

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

                 }

         }

 }