|
|
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
-
- namespace UserControlLib
- {
- public partial class User_LabelText : UserControl
- {
- public User_LabelText()
- {
- InitializeComponent();
- }
-
- private void User_LabelText_Load(object sender, EventArgs e)
- {
- textBox.Location = new Point(label.Location.X + label.Width + 3, label.Location.Y - 4);
- textBox.Width = Width - label.Width - 6;
- // textBox.ReadOnly = true;
- }
- public string LabelText
- {
- get
- {
- return label.Text.Replace(":", "");
- }
- set
- {
- label.Text = value+":";
- }
- }
-
- public new string Text
- {
- get
- {
- return textBox.Text;
- }
- set
- {
- textBox.Text = value;
- }
- }
-
-
- public string GroupId { get; set; }
-
- public string TagTypeId { get; set; }
-
- public void TagValueChanged(string tagTypeId, string value)
- {
- if (tagTypeId == TagTypeId)
- {
- textBox.Text = value;
- }
- }
-
- private void User_LabelText_SizeChanged(object sender, EventArgs e)
- {
-
- textBox.Width = Width - label.Width - 6;
- }
-
- private void label_TextChanged(object sender, EventArgs e)
- {
- textBox.Width = Width - label.Width - 6;
- }
- }
- }
|