public EditText(TextLabel textLabel) { InitializeComponent(); this.textLabel = textLabel; txtText.Text = textLabel.Text; this.Width = txtText.Width = TextRenderer.MeasureText(txtText.Text, new Font("Arial", 10)).Width; }
public void RemoveTextLabel(TextLabel txt) { Network.TextLabels.Remove(txt); drawingTextLabels.Remove(txt); UpdateField(); }
public static void DrawTextLabel(TextLabel textLabel, Brush brush, PaintEventArgs e) { StringFormat stringFormat = new StringFormat(); stringFormat.Alignment = StringAlignment.Center; e.Graphics.DrawString(textLabel.Text, new Font("Arial", 10), brush, new Point(textLabel.Location.X, textLabel.Location.Y - textLabel.TextSize.Height / 2), stringFormat); }
public TextLabel CreateTextLabel(String text, Point location) { TextLabel textLabel = new TextLabel(text, location); Network.TextLabels.Add(textLabel); drawingTextLabels.Add(textLabel); return textLabel; }