A
A
Alexander2015-11-16 15:13:18
C++ / C#
Alexander, 2015-11-16 15:13:18

How to add a TextBox at the clicked position when clicking on a PictureBox?

When we click on the toolStripButton we choose to print the text. Next, you need to click on the PictureBox and a TextBox should appear in the place where we clicked, we print the text in it, after which it is drawn below using DrawString. It is not possible to implement a TextBox on click so that it appears. It is created, but it ends up under the PictureBox, you can't even see it(
TextBox tx = new TextBox();
tx.Name = "tools";
tx.Location = new Point(eX, eY);
tx.Size = new Size(150, 150);
tx.Text = "";
this.Controls.Add(tx);0df45fcf3be444b6b75eaf0753d1394d.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-11-16
@Nipheris

tx.BringToFront();
tx.Invalidate();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question