internal MyOpaqueLayer(Control ctr, int Alpha, bool IsShowLoadingImage, string msg) { Ctr = ctr; SetStyle(ControlStyles.Opaque, value: true); CreateControl(); _alpha = Alpha; if (IsShowLoadingImage) { waitingBox = new Panel(); waitingBox.BackColor = Color.FromArgb(234, 244, 252); waitingBoxInnerPanel = new TXPanel(); waitingBoxInnerPanel.Width = 280; waitingBoxInnerPanel.Height = 80; waitingBoxInnerPanel.CornerRadius = 6; waitingBoxInnerPanel.BackBeginColor = Color.White; waitingBoxInnerPanel.BackEndColor = Color.White; waitingBoxInnerPanel.Padding = new Padding(8, 5, 5, 5); waitingBoxLab = new Label(); waitingBoxLab.TextAlign = ContentAlignment.MiddleLeft; waitingBoxLab.AutoEllipsis = true; waitingBoxLab.Dock = DockStyle.Fill; waitingBoxLab.Text = msg; waitingBoxInnerPanel.Controls.Add(waitingBoxLab); PictureBox value = new PictureBox { Dock = DockStyle.Left, Size = new Size(72, 70), Image = Resources.loading, Margin = new Padding(3, 3, 20, 3), SizeMode = PictureBoxSizeMode.CenterImage }; waitingBoxInnerPanel.Controls.Add(value); waitingBox.Controls.Add(waitingBoxInnerPanel); waitingBox.BringToFront(); if (!base.Controls.Contains(waitingBox)) { base.Controls.Add(waitingBox); } waitingBox.Height = waitingBoxInnerPanel.Height; using (Graphics graphics = CreateGraphics()) { int num = Convert.ToInt32(graphics.MeasureString(msg, waitingBoxLab.Font).Width); num = ((num >= 200) ? num : 200); num = ((Ctr.Width - 100 >= num) ? num : (Ctr.Width - 100)); waitingBoxInnerPanel.Width = num + 80; waitingBox.Width = waitingBoxInnerPanel.Width; } waitingBox.Left = (Ctr.Width - waitingBox.Width) / 2; waitingBox.Top = (Ctr.Height - waitingBox.Height) / 2; waitingBox.Show(); } }
private void CreateWaitingBox() { if (!_IsWaitingBoxCreated) { waitingBox = new Panel(); waitingBox.BackColor = Color.FromArgb(234, 244, 252); waitingBoxInnerPanel = new TXPanel(); waitingBoxInnerPanel.Width = 280; waitingBoxInnerPanel.Height = 80; waitingBoxInnerPanel.CornerRadius = 6; waitingBoxInnerPanel.BackBeginColor = Color.White; waitingBoxInnerPanel.BackEndColor = Color.White; waitingBoxInnerPanel.Padding = new Padding(8, 5, 5, 5); waitingBoxLab = new Label(); waitingBoxLab.TextAlign = ContentAlignment.MiddleLeft; waitingBoxLab.AutoEllipsis = true; waitingBoxLab.Dock = DockStyle.Fill; waitingBoxInnerPanel.Controls.Add(waitingBoxLab); PictureBox pictureBox = new PictureBox(); pictureBox.Dock = DockStyle.Left; pictureBox.Size = new Size(72, 70); pictureBox.Image = CIT.Client.Properties.Resources.loading; pictureBox.Margin = new Padding(3, 3, 20, 3); pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; _waitPicBox = pictureBox; waitingBoxInnerPanel.Controls.Add(pictureBox); waitingBox.Controls.Add(waitingBoxInnerPanel); waitingBox.BringToFront(); if (!base.Controls.Contains(waitingBox)) { base.Controls.Add(waitingBox); } waitingBox.Show(); _IsWaitingBoxCreated = true; } Rectangle workRectangle = WorkRectangle; waitingBox.Width = workRectangle.Width; waitingBox.Height = workRectangle.Height; waitingBox.Location = new Point(workRectangle.X, workRectangle.Y); _waitPicBox.Image = CIT.Client.Properties.Resources.loading; waitingBox.BackgroundImage = CreateBacgroundImage(); waitingBox.BackgroundImageLayout = ImageLayout.Stretch; }
private void InitializeComponent() { tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); panel2 = new System.Windows.Forms.Panel(); btn_no = new CIT.Client.TXButton(); btn_ok = new CIT.Client.TXButton(); txPanel1 = new CIT.Client.TXPanel(); tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); labMessage = new System.Windows.Forms.Label(); panel1 = new System.Windows.Forms.Panel(); pbImage = new System.Windows.Forms.PictureBox(); tableLayoutPanel1.SuspendLayout(); panel2.SuspendLayout(); txPanel1.SuspendLayout(); tableLayoutPanel2.SuspendLayout(); panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pbImage).BeginInit(); SuspendLayout(); tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; tableLayoutPanel1.ColumnCount = 1; tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f)); tableLayoutPanel1.Controls.Add(panel2, 0, 1); tableLayoutPanel1.Controls.Add(txPanel1, 0, 0); tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; tableLayoutPanel1.Location = new System.Drawing.Point(1, 28); tableLayoutPanel1.Name = "tableLayoutPanel1"; tableLayoutPanel1.RowCount = 2; tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 79.27461f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.72539f)); tableLayoutPanel1.Size = new System.Drawing.Size(350, 169); tableLayoutPanel1.TabIndex = 0; panel2.BackColor = System.Drawing.Color.Transparent; panel2.Controls.Add(btn_no); panel2.Controls.Add(btn_ok); panel2.Dock = System.Windows.Forms.DockStyle.Fill; panel2.Location = new System.Drawing.Point(3, 136); panel2.Name = "panel2"; panel2.Size = new System.Drawing.Size(344, 30); panel2.TabIndex = 1; btn_no.Image = null; btn_no.Location = new System.Drawing.Point(207, 0); btn_no.Name = "btn_no"; btn_no.Size = new System.Drawing.Size(85, 30); btn_no.TabIndex = 1; btn_no.Text = "取消"; btn_no.UseVisualStyleBackColor = true; btn_no.Click += new System.EventHandler(btn_no_Click); btn_ok.Image = null; btn_ok.Location = new System.Drawing.Point(64, 0); btn_ok.Name = "btn_ok"; btn_ok.Size = new System.Drawing.Size(85, 30); btn_ok.TabIndex = 0; btn_ok.Text = "确定"; btn_ok.UseVisualStyleBackColor = true; btn_ok.Click += new System.EventHandler(btn_ok_Click); txPanel1.BackColor = System.Drawing.Color.Transparent; txPanel1.BorderColor = System.Drawing.Color.FromArgb(182, 168, 192); txPanel1.Controls.Add(tableLayoutPanel2); txPanel1.Dock = System.Windows.Forms.DockStyle.Fill; txPanel1.Location = new System.Drawing.Point(3, 3); txPanel1.Name = "txPanel1"; txPanel1.Size = new System.Drawing.Size(344, 127); txPanel1.TabIndex = 2; tableLayoutPanel2.ColumnCount = 2; tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 101f)); tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100f)); tableLayoutPanel2.Controls.Add(labMessage, 1, 0); tableLayoutPanel2.Controls.Add(panel1, 0, 1); tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); tableLayoutPanel2.Name = "tableLayoutPanel2"; tableLayoutPanel2.Padding = new System.Windows.Forms.Padding(5); tableLayoutPanel2.RowCount = 3; tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50f)); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 86f)); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50f)); tableLayoutPanel2.Size = new System.Drawing.Size(344, 127); tableLayoutPanel2.TabIndex = 1; labMessage.Dock = System.Windows.Forms.DockStyle.Fill; labMessage.Location = new System.Drawing.Point(111, 8); labMessage.Margin = new System.Windows.Forms.Padding(5, 3, 3, 3); labMessage.Name = "labMessage"; tableLayoutPanel2.SetRowSpan(labMessage, 3); labMessage.Size = new System.Drawing.Size(225, 111); labMessage.TabIndex = 0; labMessage.Text = "上海开铭智能科技有限公司"; labMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; panel1.Controls.Add(pbImage); panel1.Dock = System.Windows.Forms.DockStyle.Fill; panel1.Location = new System.Drawing.Point(8, 23); panel1.Name = "panel1"; panel1.Padding = new System.Windows.Forms.Padding(5); panel1.Size = new System.Drawing.Size(95, 80); panel1.TabIndex = 1; pbImage.Dock = System.Windows.Forms.DockStyle.Fill; pbImage.Location = new System.Drawing.Point(5, 5); pbImage.Name = "pbImage"; pbImage.Padding = new System.Windows.Forms.Padding(12); pbImage.Size = new System.Drawing.Size(85, 70); pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; pbImage.TabIndex = 2; pbImage.TabStop = false; base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new System.Drawing.Size(352, 198); base.Controls.Add(tableLayoutPanel1); Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); base.Location = new System.Drawing.Point(0, 0); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "MyMsgFrm"; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; base.Load += new System.EventHandler(MyMsgFrm_Load); tableLayoutPanel1.ResumeLayout(performLayout: false); panel2.ResumeLayout(performLayout: false); txPanel1.ResumeLayout(performLayout: false); tableLayoutPanel2.ResumeLayout(performLayout: false); panel1.ResumeLayout(performLayout: false); ((System.ComponentModel.ISupportInitialize)pbImage).EndInit(); ResumeLayout(performLayout: false); }
private void InitializeComponent() { panelWorkArea = new CIT.Client.TXPanel(); tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); rbn0 = new CIT.Client.TXRadioButton(); rbn1 = new CIT.Client.TXRadioButton(); rbn3 = new CIT.Client.TXRadioButton(); rbn2 = new CIT.Client.TXRadioButton(); rbn4 = new CIT.Client.TXRadioButton(); panel1 = new System.Windows.Forms.Panel(); cbBgEnable = new CIT.Client.TXCheckBox(); label1 = new System.Windows.Forms.Label(); trackOpacity = new System.Windows.Forms.TrackBar(); picBoxBg = new System.Windows.Forms.PictureBox(); panelControlArea = new System.Windows.Forms.Panel(); btnApply = new CIT.Client.TXButton(); btnCancel = new CIT.Client.TXButton(); btnOK = new CIT.Client.TXButton(); panelWorkArea.SuspendLayout(); tableLayoutPanel1.SuspendLayout(); panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)trackOpacity).BeginInit(); ((System.ComponentModel.ISupportInitialize)picBoxBg).BeginInit(); panelControlArea.SuspendLayout(); SuspendLayout(); panelWorkArea.BackColor = System.Drawing.Color.Transparent; panelWorkArea.BorderColor = System.Drawing.Color.LightGray; panelWorkArea.Controls.Add(tableLayoutPanel1); panelWorkArea.CornerRadius = 5; panelWorkArea.Dock = System.Windows.Forms.DockStyle.Fill; panelWorkArea.ForeColor = System.Drawing.SystemColors.ControlText; panelWorkArea.Location = new System.Drawing.Point(4, 30); panelWorkArea.MinimumSize = new System.Drawing.Size(27, 27); panelWorkArea.Name = "panelWorkArea"; panelWorkArea.Size = new System.Drawing.Size(445, 205); panelWorkArea.TabIndex = 0; tableLayoutPanel1.ColumnCount = 2; tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20f)); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); tableLayoutPanel1.Controls.Add(rbn0, 1, 0); tableLayoutPanel1.Controls.Add(rbn1, 1, 1); tableLayoutPanel1.Controls.Add(rbn3, 1, 2); tableLayoutPanel1.Controls.Add(rbn2, 1, 3); tableLayoutPanel1.Controls.Add(rbn4, 1, 4); tableLayoutPanel1.Controls.Add(panel1, 1, 5); tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); tableLayoutPanel1.Name = "tableLayoutPanel1"; tableLayoutPanel1.RowCount = 6; tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28f)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel1.Size = new System.Drawing.Size(445, 205); tableLayoutPanel1.TabIndex = 1; rbn0.AutoSize = true; rbn0.Location = new System.Drawing.Point(23, 3); rbn0.MaxRadius = 8; rbn0.MinimumSize = new System.Drawing.Size(22, 22); rbn0.MinRadius = 4; rbn0.Name = "rbn0"; rbn0.Size = new System.Drawing.Size(71, 22); rbn0.TabIndex = 1; rbn0.Tag = "0"; rbn0.Text = "默认皮肤"; rbn0.UseVisualStyleBackColor = true; rbn0.CheckedChanged += new System.EventHandler(rbn_CheckedChanged); rbn1.AutoSize = true; rbn1.Location = new System.Drawing.Point(23, 31); rbn1.MaxRadius = 8; rbn1.MinimumSize = new System.Drawing.Size(22, 22); rbn1.MinRadius = 4; rbn1.Name = "rbn1"; rbn1.Size = new System.Drawing.Size(131, 22); rbn1.TabIndex = 2; rbn1.Tag = "1"; rbn1.Text = "面朝大海,春暖花开"; rbn1.UseVisualStyleBackColor = true; rbn3.AutoSize = true; rbn3.Location = new System.Drawing.Point(23, 59); rbn3.MaxRadius = 8; rbn3.MinimumSize = new System.Drawing.Size(22, 22); rbn3.MinRadius = 4; rbn3.Name = "rbn3"; rbn3.Size = new System.Drawing.Size(131, 22); rbn3.TabIndex = 3; rbn3.Tag = "3"; rbn3.Text = "如花美眷,流年似水"; rbn3.UseVisualStyleBackColor = true; rbn2.AutoSize = true; rbn2.Location = new System.Drawing.Point(23, 87); rbn2.MaxRadius = 8; rbn2.MinimumSize = new System.Drawing.Size(22, 22); rbn2.MinRadius = 4; rbn2.Name = "rbn2"; rbn2.Size = new System.Drawing.Size(71, 22); rbn2.TabIndex = 4; rbn2.Tag = "2"; rbn2.Text = "天使之吻"; rbn2.UseVisualStyleBackColor = true; rbn4.AutoSize = true; rbn4.Location = new System.Drawing.Point(23, 115); rbn4.MaxRadius = 8; rbn4.MinimumSize = new System.Drawing.Size(22, 22); rbn4.MinRadius = 4; rbn4.Name = "rbn4"; rbn4.Size = new System.Drawing.Size(131, 22); rbn4.TabIndex = 5; rbn4.Tag = "4"; rbn4.Text = "夕阳西下,明月天涯"; rbn4.UseVisualStyleBackColor = true; panel1.Controls.Add(cbBgEnable); panel1.Controls.Add(label1); panel1.Controls.Add(trackOpacity); panel1.Controls.Add(picBoxBg); panel1.Dock = System.Windows.Forms.DockStyle.Fill; panel1.Location = new System.Drawing.Point(23, 143); panel1.Name = "panel1"; panel1.Size = new System.Drawing.Size(419, 59); panel1.TabIndex = 6; cbBgEnable.AutoSize = true; cbBgEnable.Location = new System.Drawing.Point(3, 17); cbBgEnable.MinimumSize = new System.Drawing.Size(20, 20); cbBgEnable.Name = "cbBgEnable"; cbBgEnable.Size = new System.Drawing.Size(96, 20); cbBgEnable.TabIndex = 3; cbBgEnable.Text = "开启主题背景"; cbBgEnable.UseVisualStyleBackColor = true; label1.AutoSize = true; label1.Location = new System.Drawing.Point(208, 20); label1.Name = "label1"; label1.Size = new System.Drawing.Size(41, 12); label1.TabIndex = 2; label1.Text = "透明度"; trackOpacity.BackColor = System.Drawing.Color.White; trackOpacity.Location = new System.Drawing.Point(244, 14); trackOpacity.Maximum = 100; trackOpacity.Name = "trackOpacity"; trackOpacity.Size = new System.Drawing.Size(168, 45); trackOpacity.TabIndex = 1; trackOpacity.TickFrequency = 5; trackOpacity.Value = 20; picBoxBg.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; picBoxBg.Location = new System.Drawing.Point(105, 4); picBoxBg.Name = "picBoxBg"; picBoxBg.Size = new System.Drawing.Size(68, 50); picBoxBg.TabIndex = 0; picBoxBg.TabStop = false; picBoxBg.Click += new System.EventHandler(picBoxBg_Click); panelControlArea.BackColor = System.Drawing.Color.Transparent; panelControlArea.Controls.Add(btnApply); panelControlArea.Controls.Add(btnCancel); panelControlArea.Controls.Add(btnOK); panelControlArea.Dock = System.Windows.Forms.DockStyle.Bottom; panelControlArea.Location = new System.Drawing.Point(4, 235); panelControlArea.Margin = new System.Windows.Forms.Padding(0); panelControlArea.Name = "panelControlArea"; panelControlArea.Size = new System.Drawing.Size(445, 30); panelControlArea.TabIndex = 1; btnApply.Image = null; btnApply.Location = new System.Drawing.Point(182, 1); btnApply.Name = "btnApply"; btnApply.Size = new System.Drawing.Size(80, 25); btnApply.TabIndex = 2; btnApply.Text = "应 用"; btnApply.UseVisualStyleBackColor = true; btnApply.Click += new System.EventHandler(btnApply_Click); btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; btnCancel.Image = null; btnCancel.Location = new System.Drawing.Point(271, 1); btnCancel.Name = "btnCancel"; btnCancel.Size = new System.Drawing.Size(80, 25); btnCancel.TabIndex = 1; btnCancel.Text = "取 消"; btnCancel.UseVisualStyleBackColor = true; btnCancel.Click += new System.EventHandler(OnBtnCancelClick); btnOK.Image = null; btnOK.Location = new System.Drawing.Point(93, 1); btnOK.Name = "btnOK"; btnOK.Size = new System.Drawing.Size(80, 25); btnOK.TabIndex = 0; btnOK.Text = "确 定"; btnOK.UseVisualStyleBackColor = true; btnOK.Click += new System.EventHandler(OnBtnOkClick); base.AcceptButton = btnOK; base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.CancelButton = btnCancel; base.ClientSize = new System.Drawing.Size(453, 266); base.Controls.Add(panelWorkArea); base.Controls.Add(panelControlArea); base.CornerRadius = 1; Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); base.Location = new System.Drawing.Point(0, 0); base.MaximizeBox = false; base.Name = "frmSkinManager"; base.Padding = new System.Windows.Forms.Padding(3, 3, 3, 0); base.ResizeEnable = false; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; Text = "皮肤管理中心"; base.Load += new System.EventHandler(frmSkinManager_Load); panelWorkArea.ResumeLayout(performLayout: false); tableLayoutPanel1.ResumeLayout(performLayout: false); tableLayoutPanel1.PerformLayout(); panel1.ResumeLayout(performLayout: false); panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)trackOpacity).EndInit(); ((System.ComponentModel.ISupportInitialize)picBoxBg).EndInit(); panelControlArea.ResumeLayout(performLayout: false); ResumeLayout(performLayout: false); }