public BiblioAndEntities( Form owner, EasyMarcControl easyMarcControl1, FlowLayoutPanel flowLayoutPanel1) { this.Owner = owner; this.easyMarcControl1 = easyMarcControl1; this.flowLayoutPanel1 = flowLayoutPanel1; }
// TODO: 首次设置颜色也尽量调用 SetLineColor() 实现,这样可以共享代码,减少多处修改带来的麻烦 public EasyLine(EasyMarcControl container) { this.Container = container; // int nTopBlank = (int)this.Container.Font.GetHeight() + 2; label_color = new Label(); label_color.Dock = DockStyle.Fill; label_color.Size = new Size(6, 23); label_color.Margin = new Padding(0, 0, 0, 0); label_color.ImageList = this.Container.ImageListIcons; label_color.ImageIndex = -1; label_color.BackColor = this.Container.LeftBackColor; label_caption = new Label(); label_caption.Dock = DockStyle.Fill; label_caption.Size = new Size(6, 23); label_caption.AutoSize = true; label_caption.Margin = new Padding(4, 6, 4, 4); // new Padding(4, 2, 4, 0) label_caption.TextAlign = ContentAlignment.TopLeft; // label_caption.BackColor = SystemColors.Control; label_caption.BackColor = Color.Transparent; // label_caption.ForeColor = this.Container.ForeColor; splitter = new TransparentSplitter(); // splitter.Dock = DockStyle.Fill; splitter.Size = new Size(8, 23); splitter.Width = 8; splitter.Margin = new Padding(0, 0, 0, 0); splitter.BackColor = Color.Transparent; // 字段/子字段内容 this.textBox_content = new AutoHeightTextBox(); textBox_content.Multiline = true; textBox_content.WordWrap = true; textBox_content.BorderStyle = BorderStyle.None; textBox_content.Dock = DockStyle.Fill; textBox_content.MinimumSize = new Size(20, 21); // 23 textBox_content.Size = new Size(20, 21); // 23 textBox_content.Margin = new Padding(8, 6, 0, 2); // new Padding(8, 4, 0, 0) // textBox_content.BackColor = Color.Red; if (this.Container.BackColor != Color.Transparent) textBox_content.BackColor = this.Container.BackColor; else textBox_content.Tag = textBox_content.BackColor; textBox_content.ForeColor = this.Container.ForeColor; }
void DisposeChildControls() { List<Control> controls = RemoveControls(); foreach (Control control in controls) { if (control != null) control.Dispose(); } Container = null; }
public IndicatorLine(EasyMarcControl container) : base(container) { this.label_caption.TextAlign = ContentAlignment.MiddleRight; }
public SubfieldLine(EasyMarcControl container) : base(container) { this.label_caption.TextAlign = ContentAlignment.TopRight; // this.label_caption.BackColor = SystemColors.Window; this.label_caption.ForeColor = container.SubfieldCaptionForeColor; // SystemColors.GrayText; }
public FieldLine(EasyMarcControl container) : base(container) { // this.textBox_content.ReadOnly = true; this.label_caption.Font = new Font(this.Container.Font, FontStyle.Bold); this.label_caption.ForeColor = this.Container.FieldCaptionForeColor; // Color.DarkGreen; this.textBox_content.KeyPress -= new KeyPressEventHandler(textBox_content_KeyPress); this.textBox_content.KeyPress += new KeyPressEventHandler(textBox_content_KeyPress); this.textBox_content.KeyDown -= new KeyEventHandler(textBox_content_KeyDown); this.textBox_content.KeyDown += new KeyEventHandler(textBox_content_KeyDown); }
void DisposeChildControls() { label_color.Dispose(); label_caption.Dispose(); splitter.Dispose(); textBox_content.Dispose(); Container = null; }