Adding your own toolbox controls to the IDE and linking up their events...
-
I am recently curious about the process of writing your own toolbox controls. Let's take a basic approach and say I wanted to write a textbox control that was always multi-line with both scrollbars. I want to have all the events, properties and such. How do you wire up events so that when you drag the textbox onto the form and double-click it the IDE goes to the correct handler or default handler like in the case of a button it's the Button_Click. How do I make my own button control and when I double-click it in the IDE have it go instead to Button_MouseDown or something else entirely? How do you add events for the IDE and design time? I'd google this I just don't know what search terms to use. I've tried and failed.
-
I am recently curious about the process of writing your own toolbox controls. Let's take a basic approach and say I wanted to write a textbox control that was always multi-line with both scrollbars. I want to have all the events, properties and such. How do you wire up events so that when you drag the textbox onto the form and double-click it the IDE goes to the correct handler or default handler like in the case of a button it's the Button_Click. How do I make my own button control and when I double-click it in the IDE have it go instead to Button_MouseDown or something else entirely? How do you add events for the IDE and design time? I'd google this I just don't know what search terms to use. I've tried and failed.
code-frog wrote:
How do you wire up events so that when you drag the textbox onto the form and double-click it the IDE goes to the correct handler or default handler like in the case of a button it's the Button_Click.
If your control is derived from Button control, this should be happening automatically.
code-frog wrote:
How do I make my own button control and when I double-click it in the IDE have it go instead to Button_MouseDown or something else entirely?
If I remember correctly, DefaultEventAttribute[^] should do the trick.
code-frog wrote:
How do you add events for the IDE and design time?
IDE should show up any public events that your control provides without doing anything special. :)
Best wishes, Navaneeth