Ejemplo n.º 1
0
        /// <summary>
        /// Creates the waiting box.
        /// </summary>
        /// User:Ryan  CreateTime:2012-8-5 16:22.
        private void CreateWaitingBox()
        {
            if (!this._IsWaitingBoxCreated)
            {
                #region CreateWaitingBox

                this.waitingBox = new System.Windows.Forms.Panel();
                //ControlHelper.BindMouseMoveEvent(this.waitingBox);
                waitingBox.BackColor = Color.FromArgb(234, 244, 252);
                ////innerpanel
                waitingBoxInnerPanel                = new TXPanel();
                waitingBoxInnerPanel.Width          = 280;
                waitingBoxInnerPanel.Height         = 80;
                waitingBoxInnerPanel.CornerRadius   = 6;
                waitingBoxInnerPanel.BackBeginColor = Color.White;
                waitingBoxInnerPanel.BackEndColor   = Color.White;
                waitingBoxInnerPanel.Padding        = new System.Windows.Forms.Padding(8, 5, 5, 5);
                ////label
                waitingBoxLab              = new Label();
                waitingBoxLab.TextAlign    = ContentAlignment.MiddleLeft;
                waitingBoxLab.AutoEllipsis = true;
                waitingBoxLab.Dock         = DockStyle.Fill;
                //waitingBox.AutoSize = false;
                //ControlHelper.BindMouseMoveEvent(this.waitingBoxLab);
                waitingBoxInnerPanel.Controls.Add(waitingBoxLab);
                ////pictruebox
                PictureBox pb = new PictureBox();
                pb.Dock          = DockStyle.Left;
                pb.Size          = new System.Drawing.Size(72, 70);
                pb.Image         = LoadResource.GetRandomLoadImage();
                pb.Margin        = new System.Windows.Forms.Padding(3, 3, 20, 3);
                pb.SizeMode      = PictureBoxSizeMode.StretchImage;
                this._waitPicBox = pb;
                waitingBoxInnerPanel.Controls.Add(pb);
                ////...
                waitingBox.Controls.Add(waitingBoxInnerPanel);
                waitingBox.BringToFront();
                if (!this.Controls.Contains(waitingBox))
                {
                    this.Controls.Add(waitingBox);
                }
                waitingBox.Show();
                this._IsWaitingBoxCreated = true;
                #endregion
            }

            Rectangle rect = this.WorkRectangle;
            waitingBox.Width           = rect.Width;
            waitingBox.Height          = rect.Height;
            waitingBox.Location        = new Point(rect.X, rect.Y);
            this._waitPicBox.Image     = LoadResource.GetRandomLoadImage();
            waitingBox.BackgroundImage = this.CreateBacgroundImage();
            //waitingBox.BackgroundImage = Properties.Resources.logo_mini;
            waitingBox.BackgroundImageLayout = ImageLayout.Stretch;
        }
Ejemplo n.º 2
0
 public TXWaitingBox(WaitWindow parent)
 {
     InitializeComponent();
     this.MaximizeBox         = false;
     this.MinimizeBox         = false;
     this.ControlBox          = false;
     this.ShowInTaskbar       = false;
     _Parent                  = parent;
     this.Opacity             = 0.95f;
     this.labWaitMessage.Text = "正在处理,请稍候..."
                                + "\n"
                                + "Dear,Please wait a moment !";
     this.txPanel1.BackEndColor = this.GetRandomColor();
     ControlHelper.BindMouseMoveEvent(this.labWaitMessage);
     //加载的图片
     this.loadImage.Image = LoadResource.GetRandomLoadImage();
 }