- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Drawing;
- using System.ComponentModel;
- namespace WindowsFormsApplication10
- {
- public partial class LabelTx : System.Windows.Forms.Label
- {
- int lineDistance = 5;//行间距
- Graphics gcs;
- int iHeight = 0, height = 200;
- string[] nrLine;
- string[] nrLinePos;
- int searchPos = 0;
- int section = 1;
- public int LineDistance
- {
- get { return lineDistance; }
- set
- {
- lineDistance = value;
- Changed(this.Font, this.Width, this.Text);
- }
- }
- public LabelTx()
- : base()
- {
- //this.TextChanged += new EventHandler(LabelTx_TextChanged);
- this.SizeChanged += new EventHandler(LabelTx_SizeChanged);
- this.FontChanged += new EventHandler(LabelTx_FontChanged);
- //this.Font = new Font(this.Font.FontFamily, this.Font.Size, GraphicsUnit.Pixel);
- }
- void LabelTx_FontChanged(object sender, EventArgs e)
- {
- Changed(this.Font, this.Width, this.Text);
- }
- void LabelTx_SizeChanged(object sender, EventArgs e)
- {
- Changed(this.Font, this.Width, this.Text);
- }
- public LabelTx(IContainer container)
- {
- container.Add(this);
- //base.Height
- //InitializeComponent();
- }