Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Adding your own toolbox controls to the IDE and linking up their events...

Adding your own toolbox controls to the IDE and linking up their events...

Scheduled Pinned Locked Moved C#
questionvisual-studiodesign
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    code frog 0
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • C code frog 0

      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.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups