Exemple #1
0
        public void InitializeShadows()
        {
            topFormShadow = new ChromeShadowElement(ShadowDockPositon.Top, parentWindowHWnd, this);

            leftFormShadow   = new ChromeShadowElement(ShadowDockPositon.Left, parentWindowHWnd, this);
            bottomFormShadow = new ChromeShadowElement(ShadowDockPositon.Bottom, parentWindowHWnd, this);
            rightFormShadow  = new ChromeShadowElement(ShadowDockPositon.Right, parentWindowHWnd, this);

            shadows.Add(topFormShadow);
            shadows.Add(leftFormShadow);
            shadows.Add(bottomFormShadow);
            shadows.Add(rightFormShadow);

            User32.ShowWindow(topFormShadow.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(leftFormShadow.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(bottomFormShadow.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(rightFormShadow.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);

            topFormShadow.ExternalResizeEnable    = Resizable;
            leftFormShadow.ExternalResizeEnable   = Resizable;
            bottomFormShadow.ExternalResizeEnable = Resizable;
            rightFormShadow.ExternalResizeEnable  = Resizable;


            isInitialized = true;

            AssignHandle(parentWindowHWnd);

            AlignSideShadowToTopMost();

            ShadowColor = shadowColor;
        }
Exemple #2
0
        private void CloseShadows()
        {
            foreach (var sideShadow in shadows)
            {
                sideShadow.Close();
            }

            shadows.Clear();

            topFormShadow    = null;
            bottomFormShadow = null;
            leftFormShadow   = null;
            rightFormShadow  = null;
        }