How to add button to textbox?

前端 未结 5 1759
死守一世寂寞
死守一世寂寞 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:24

    At first a Question: Do you need one or more Button at the side of your TextBox? So you need a Property Button or Buttons for one Button or a Collection

    If the Button is not so complex that you have to make a lot of specific functions, you use the UserControl. It is the right way. Otherwise you have to take a CustomControl, more work.

    Logical Steps:

    • Create one of the given Controls from above
    • Make a Property Button or Buttons
    • Use Docking-Layout, it is easier

提交回复
热议问题