コード例 #1
0
        private void SetImages()
        {
            UpArrowImage   = Resource.uparrow;
            DownArrowImage = Resource.downarrow;

            ThumbBottomImage     = Resource.ThumbBottomBlue;
            ThumbBottomSpanImage = Resource.ThumbSpanBottomBlue;
            ThumbTopImage        = Resource.ThumbTopBlue;
            ThumbTopSpanImage    = Resource.ThumbSpanTopBlue;
            ThumbMiddleImage     = Resource.ThumbMiddleBlue;

            if (!moVScroll)
            {
                UpArrowImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                DownArrowImage.RotateFlip(RotateFlipType.Rotate90FlipXY);

                ThumbMiddleImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                ThumbTopImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                ThumbBottomImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                ThumbBottomSpanImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                ThumbTopSpanImage.RotateFlip(RotateFlipType.Rotate90FlipXY);
                Debug.WriteLine("width v1: " + moVScroll.ToString());
            }

            this.MinimumSize = moVScroll ? new Size(moUpArrowImage.Width, moUpArrowImage.Height + moDownArrowImage.Height + nThumbLength) :
                               new Size(moUpArrowImage.Width + moDownArrowImage.Width + nThumbLength, moUpArrowImage.Height);

            if (!moVScroll)
            {
                int width = this.Width;
                this.Width  = (this.Size.Width > this.Size.Height ? this.Size.Width : (this.Size.Height > moUpArrowImage.Width + moDownArrowImage.Width + nThumbLength) ? this.Size.Height : moUpArrowImage.Width + moDownArrowImage.Width + nThumbLength);
                this.Height = moVScroll ? ((width > moUpArrowImage.Height + moDownArrowImage.Height + moThumbMiddleImage.Height + nThumbLength) ? width : moUpArrowImage.Height + moDownArrowImage.Height + nThumbLength) : moUpArrowImage.Height;
            }
            else
            {
                int width = this.Width;

                this.Width = moVScroll ? moUpArrowImage.Width :
                             ((this.Size.Width > moUpArrowImage.Width + moDownArrowImage.Width + moThumbMiddleImage.Width + nThumbLength) ? this.Size.Width : moUpArrowImage.Width + moDownArrowImage.Width + moThumbMiddleImage.Width + nThumbLength);
                this.Height = moVScroll ? ((this.Size.Height > moUpArrowImage.Height + moDownArrowImage.Height + nThumbLength) ? this.Size.Width : moUpArrowImage.Height + moDownArrowImage.Height + moThumbMiddleImage.Height + nThumbLength) : moUpArrowImage.Height;
            }
            SetValues();
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (CenterText != null)
            {
                CenterText.Dispose();
                CenterText = null;
            }

            if (RightArrowImage != null)
            {
                RightArrowImage.Dispose();
                RightArrowImage = null;
            }

            if (LeftArrowImage != null)
            {
                LeftArrowImage.Dispose();
                LeftArrowImage = null;
            }

            if (UpArrowImage != null)
            {
                UpArrowImage.Dispose();
                UpArrowImage = null;
            }

            if (NavigateText != null)
            {
                NavigateText.Dispose();
                NavigateText = null;
            }

            if (NavigateButton != null)
            {
                NavigateButton.Dispose();
                NavigateButton = null;
            }
        }