private void MoleculeViewer_MouseMove(object sender, MouseEventArgs e)
        {
            System.Drawing.Point dragPoint  = gscTogoc(e.X, e.Y);
            System.Drawing.Point MousePoint = gscTogoc(e.X, e.Y);
            dragPoint.Offset(dragOffset.X, dragOffset.Y);
            System.Drawing.Size minSize = new System.Drawing.Size(16, 16);
            if (SelectedObject != null)
            {
                if (m_DraggingSelectedObject)
                {
                    Rectangle rect = new System.Drawing.Rectangle(SelectedObject.GetPosition().X, SelectedObject.GetPosition().Y, SelectedObject.Width, SelectedObject.Height);
                    SelectedObject.SetPosition(dragPoint);
                    if (StatusUpdate != null)
                    {
                        StatusUpdate(this, new StatusUpdateEventArgs(StatusUpdateType.ObjectMoved,
                                                                     SelectedObject, String.Format("Object Moved to {0}, {1}", dragPoint.X, dragPoint.Y),
                                                                     dragPoint, 0));
                    }
                    Invalidate();
                }
                else if (m_RotatingSelectedObject)
                {
                    float currentRotation;
                    currentRotation         = (float)AngleToPoint(SelectedObject.GetPosition(), dragPoint);
                    currentRotation         = (float)((int)(currentRotation - startingRotation + originalRotation) % 360);
                    SelectedObject.Rotation = currentRotation;
                    if (StatusUpdate != null)
                    {
                        StatusUpdate(this, new StatusUpdateEventArgs(StatusUpdateType.ObjectRotated,
                                                                     SelectedObject, String.Format("Object Rotated to {0} degrees", currentRotation),
                                                                     new System.Drawing.Point(0, 0), currentRotation));
                    }
                    Invalidate();
                }
                else if (resizing)
                { //combine code because you will need to move ports in both cases
                    System.Drawing.Rectangle rect    = new System.Drawing.Rectangle(SelectedObject.X, SelectedObject.Y, SelectedObject.Width, SelectedObject.Height);
                    System.Drawing.Size      sz      = new System.Drawing.Size(0, 0);
                    System.Drawing.Point     fixedPT = new System.Drawing.Point(0, 0);
                    System.Drawing.Point     dragPT  = new System.Drawing.Point(0, 0);
                    SelectedObject.AutoSize = false;
                    switch (sz_direct)
                    {
                    case SizeDirection.Northwest:      //changing all
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        System.Drawing.Point LRHC = new System.Drawing.Point(0, 0);
                        sz        = SelectedObject.GetSize();
                        LRHC.X    = ULHC.X + sz.Width;
                        LRHC.Y    = ULHC.Y + sz.Height;
                        sz.Width  = LRHC.X - MousePoint.X;
                        sz.Height = LRHC.Y - MousePoint.Y;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        ULHC.X = LRHC.X - sz.Width;
                        ULHC.Y = LRHC.Y - sz.Height;
                        SelectedObject.SetPosition(ULHC);
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.North:    //changing top, and height
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        System.Drawing.Point LLHC = new System.Drawing.Point(0, 0);
                        LLHC.X    = ULHC.X;
                        sz        = SelectedObject.GetSize();
                        LLHC.Y    = ULHC.Y + sz.Height;
                        sz.Height = LLHC.Y - MousePoint.Y;
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        ULHC.Y = LLHC.Y - sz.Height;
                        SelectedObject.SetPosition(ULHC);
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.Northeast:    //changing top, width, and height
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        System.Drawing.Point LLHC = new System.Drawing.Point(0, 0);
                        sz        = SelectedObject.GetSize();
                        LLHC.X    = ULHC.X;
                        LLHC.Y    = ULHC.Y + sz.Height;
                        sz.Width  = MousePoint.X - LLHC.X;
                        sz.Height = LLHC.Y - MousePoint.Y;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        ULHC.X = LLHC.X;
                        ULHC.Y = LLHC.Y - sz.Height;
                        SelectedObject.SetPosition(ULHC);
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.East:     //changing width
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        sz       = SelectedObject.GetSize();
                        sz.Width = MousePoint.X - ULHC.X;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.Southeast:      //changing height, width
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        sz        = SelectedObject.GetSize();
                        sz.Width  = MousePoint.X - ULHC.X;
                        sz.Height = MousePoint.Y - ULHC.Y;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.South:    //changing height
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        sz        = SelectedObject.GetSize();
                        sz.Height = MousePoint.Y - ULHC.Y;
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.Southwest:      //changing left,height, and width
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        System.Drawing.Point URHC = new System.Drawing.Point(0, 0);
                        sz        = SelectedObject.GetSize();
                        URHC.Y    = ULHC.Y;
                        URHC.X    = ULHC.X + sz.Width;
                        sz.Width  = URHC.X - MousePoint.X;
                        sz.Height = MousePoint.Y - URHC.Y;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        if (sz.Height < 16)
                        {
                            sz.Height = 16;
                        }
                        ULHC.X = URHC.X - sz.Width;
                        SelectedObject.SetPosition(ULHC);
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    case SizeDirection.West:    //changing left and width
                    {
                        System.Drawing.Point ULHC = SelectedObject.GetPosition();
                        System.Drawing.Point URHC = new System.Drawing.Point(0, 0);
                        sz       = SelectedObject.GetSize();
                        URHC.Y   = ULHC.Y;
                        URHC.X   = ULHC.X + sz.Width;
                        sz.Width = URHC.X - MousePoint.X;
                        if (sz.Width < 16)
                        {
                            sz.Width = 16;
                        }
                        ULHC.X = URHC.X - sz.Width;
                        SelectedObject.SetPosition(ULHC);
                        SelectedObject.SetSize(sz);
                        break;
                    }

                    default:
                        break;
                    }
                }
            }
            //else if (this.GetDrawingLine())
            //{
            //    //this.Cursor = Cursors.Cross;
            //    System.Drawing.Point points[] = this.GetDrawingLinePoints();
            //    points[points.Length - 1] = gscTogoc(e.X, e.Y);
            //    this.SetDrawingLinePoints(points);
            //    this.Invalidate();
            //}
            else if (m_SelectionDragging)
            {
                m_SelectionRectangle.Width  = e.X - m_SelectionRectangle.X;
                m_SelectionRectangle.Height = e.Y - m_SelectionRectangle.Y;
            }
            else if (m_RotatingSurface)
            {
                surfaceRotation = surfaceRotation + (float)AngleToPoint(dragOffset, dragPoint) / 100;
                //currentRotation = ((int)(currentRotation - startingRotation + originalRotation) % 360);
                if (StatusUpdate != null)
                {
                    StatusUpdate(this, new StatusUpdateEventArgs(StatusUpdateType.ObjectRotated,
                                                                 SelectedObject, String.Format("Surface Rotated to {0} degrees", surfaceRotation),
                                                                 new System.Drawing.Point(0, 0), surfaceRotation));
                }
                Invalidate();
            }
            Invalidate();
        }