public FormPopup(LinkLabelMy linklabel) { textBox = new TextBox(); button = new Button(); textBox.Name = "textBox"; textBox.Size = new Size(100, 50); textBox.Location = new Point(4, 7); textBox.Text = linklabel.Value; button.Name = "button"; button.Size = new Size(textBox.Size.Height, textBox.Size.Height); button.Font = new Font("Symbol", 6f); button.Location = new Point( textBox.Location.X + textBox.Size.Width + 2, textBox.Location.Y); button.TextAlign = ContentAlignment.TopCenter; button.Text = "®"; this.Controls.Add(textBox); this.Controls.Add(button); this.FormBorderStyle = FormBorderStyle.None; this.Location = linklabel.Parent.PointToScreen(linklabel.Location) + linklabel.Size; this.Size = textBox.Size + new Size(10 + button.Width, 0); this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.Manual; textBox.Select(); textBox.KeyPress += new KeyPressEventHandler(textBox_KeyPress); button.Click += new EventHandler(button_Click); this.Deactivate += new EventHandler(FormPopup_Deactivate); }
private void linkLabel1_TextChanged(object sender, EventArgs e) { LinkLabelMy label = (LinkLabelMy)sender; errorProvider1.SetError(label, ""); }