Ejemplo n.º 1
0
        // if a shadow window does not yet exist, create it
        private bool bMakeShadow()
        {
            // a shadow cannot have another shadow
            if (this.m_bIsShadow)
            {
                return(false);
            }

            // only generate a shadow if required
            if (m_bHasShadow != true)
            {
                return(false);
            }

            // no shadows in design mode
            if (DesignMode == true)
            {
                return(false);
            }

            // create shadow if non exists
            if (m_fmShadow == null)
            {
                m_fmShadow               = new CBalloon.CBalloonBase();
                this.Owner               = m_fmShadow;
                m_fmShadow.Width         = this.Width;
                m_fmShadow.Height        = this.Height;
                m_fmShadow.StartPosition = FormStartPosition.Manual;
                m_fmShadow.Location      = new Point(this.Location.X + C_SHADOW, this.Location.Y + C_SHADOW);
                m_fmShadow.IsShadow      = true;
                m_fmShadow.Opacity       = 0.6;
            }
            return(true);
        }
Ejemplo n.º 2
0
 private void DestroyShadow()
 {
     if (m_fmShadow != null)
     {
         // if the shadow has an owner, we need to attach the balloon to the owner and
         // sever existing owned form relationships
         if (m_fmShadow.Owner != null)
         {
             this.Owner = m_fmShadow.Owner;
             m_fmShadow.RemoveOwnedForm(this);
             this.Owner.RemoveOwnedForm(m_fmShadow);
         }
         m_fmShadow.Close();
         m_fmShadow.Dispose();
         m_fmShadow = null;
     }
 }