How to add button to textbox?

前端 未结 5 1768
死守一世寂寞
死守一世寂寞 2021-01-16 16:35

I\'m trying to make a TextBox with a button on the right side. My code:

public partial class TextBoxButton : TextBox
{
    [Category(\"Button\")]
    [Descri         


        
5条回答
  •  情深已故
    2021-01-16 17:16

    Not sure what you mean by "in the text box". Do you mean you want to have the button covering the right side of the text box, or located to the right of the text box (but not overlapping)?

    I'm not sure what your requirements are, but I would probably do this in the Visual Designer rather than try to do it in code:

    1. create a new control
    2. create a table container with two columns and 1 row.
    3. Put the text box in the left cell, and the button in the right cell.

提交回复
热议问题