//增加图片 private void AddPic(Image picImage, string title, string pageNo) { imageTitle imagetitle = new imageTitle() { image = picImage, title = title, pageNo = pageNo }; CJia.Controls.CJiaPicture pic = new Controls.CJiaPicture(); pic.Image = picImage; pic.Location = new System.Drawing.Point(1, 1); pic.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; pic.Properties.Appearance.Options.UseBackColor = true; pic.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; pic.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom; pic.Size = new System.Drawing.Size(160, 120); CJia.Controls.CJiaLabel label = new Controls.CJiaLabel(); label.Appearance.Font = new System.Drawing.Font("Tahoma", 10F); label.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; label.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; label.Location = new System.Drawing.Point(1, 130); label.Size = new System.Drawing.Size(156, 16); label.Text = title + " " + pageNo; CJia.Controls.CJiaLabel line = new Controls.CJiaLabel(); line.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; line.LineVisible = true; line.Location = new System.Drawing.Point(1, 142); line.LookAndFeel.SkinName = "Office 2010 Blue"; line.LookAndFeel.UseDefaultLookAndFeel = false; line.Size = new System.Drawing.Size(160, 10); CJia.Controls.CJiaPanel panel = new Controls.CJiaPanel(); panel.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(237)))), ((int)(((byte)(241))))); panel.Appearance.Options.UseBackColor = true; panel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; panel.Controls.Add(label); panel.Controls.Add(pic); panel.Controls.Add(line); panel.Location = new System.Drawing.Point(3, height + 3); panel.LookAndFeel.SkinName = "Office 2010 Silver"; panel.LookAndFeel.UseDefaultLookAndFeel = false; panel.Size = new System.Drawing.Size(140, 130); panel.Tag = imagetitle; panel.Enter += new System.EventHandler(panel_Enter); imagePanel.Controls.Add(panel); this.height += 130; }
private void panel_Enter(object sender, EventArgs e) { CJia.Controls.CJiaPanel panel = sender as CJia.Controls.CJiaPanel; if (imagePanel.Controls != null && imagePanel.Controls.Count > 0) { for (int i = 0; i < imagePanel.Controls.Count; i++) { if (imagePanel.Controls[i] is CJia.Controls.CJiaPanel) { imagePanel.Controls[i].BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(237)))), ((int)(((byte)(241))))); } } } panel.BackColor = Color.LightCyan; imageTitle imagetitle = panel.Tag as imageTitle; this.picDA.Image = imagetitle.image; this.labTitle.Text = imagetitle.title; this.labPageNo.Text = imagetitle.pageNo; }
SetProperty(ref imageTitle, value);