예제 #1
0
        public void RemoveItem(string TBText)
        {
            DraggableTB tb = GetItem(TBText);

            if (tb != null)
            {
                items.Remove(tb);
                ContentPanel.Controls.Remove(tb);
            }
        }
예제 #2
0
 public void AddItem(string TBText)
 {
     if (!HasItem(TBText))
     {
         DraggableTB tb = new DraggableTB();
         tb.TBText = TBText;
         tb.textBox.TextChanged += new EventHandler(textBox_TextChanged);
         items.Add(tb);
         ContentPanel.Controls.Add(tb);
         tb.Dock = DockStyle.Left;
         tb.BringToFront();
     }
 }
예제 #3
0
        void textBox_TextChanged(object sender, EventArgs e)
        {
            TextBox     box = sender as TextBox;
            DraggableTB tb  = GetItem(box.Text);

            if (box.Text == "" || (tb != null && tb.textBox != box))
            {
                box.BackColor = Color.Red;
            }
            else
            {
                box.BackColor = SystemColors.Window;
            }
        }