How to put an extended WinForms Control on ToolBox

后端 未结 8 1961
自闭症患者
自闭症患者 2020-12-11 02:53

I plan to add functionalities to TextBox with the following:

   public class TextBoxExt : TextBox  
    {
        protected override void OnKeyPress(KeyPress         


        
8条回答
  •  遥遥无期
    2020-12-11 03:47

    1. Build you project with TextBoxExt, make sure it compiles ok.
    2. With the form that you want TextBoxExt on, open the toolbox, right click and select "choose items"
    3. Browse to you .exe or dll that you compiled in 1)
    4. make sure that TextBoxExt has a tick next to it, press ok
    5. TextBoxExt should appear in the toolbox, drag it onto your form

    (There is another way of doing this, opening the designer file and renaming the instances of TextBox to TextBoxExt but manual editing of designer files can be considered hazardous by some)

提交回复
热议问题