0

I am placing a textbox within a textbox like this:

enter image description here

I have achieved the above with the following code:

        var innerTextBox = new TextBox();
        innerTextBox.Width = 100;

        var outerTextBox = new TextBox();
        outerTextBox.Multiline = true;
        outerTextBox.Height = 100;
        outerTextBox.Width = 200;

        outerTextBox.Controls.Add(innerTextBox);
  1. Now the problem is that the text goes behind the textbox, how can I prevent that?

  2. I would also like the textbox inside to behave as text so that one can delete it with backspace just like regular text.

Can somebody please point me to the right direction?

This is a winforms project.

Thanks a lot!

4

1 回答 1

0

您是否尝试过 txt.BringToFront 或 txt.SendToBack?

我从您的问题中得到的是,您希望前面的文本框具有透明度。您是否尝试过使用标签?默认情况下,标签是透明的,可以在更改文本框的文本时进行修改。

于 2013-10-08T17:49:48.853 回答