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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Enter key pressed in a VS.NET addin control

Enter key pressed in a VS.NET addin control

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiohelptutorial
3 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.
  • N Offline
    N Offline
    Nathan Tran
    wrote on last edited by
    #1

    Hi, I'm developing an irc client add-in for vs.net. On the control hosted by a toolbox window I have various textbox controls. I'm trying to acknowledge when the ENTER key is pressed within a textbox. I've done this before on a winform so I do know how to use the KeyDown, KeyUp, KeyPress events to check for the e.KeyCode == Keys.Return or e.KeyChar == '\r' or e.KeyChar == (char)13. None of these methods work. I have reason to believe that the problem arises from the fact that the textbox is hosted in a CUSTOM control and not a form. From tests I've done, I found out that the textbox does not process the following keys: ENTER, NUMPAD ENTER, CONTROL, ALT, etc...the list goes on. How do I get the textbox to process ENTER key presses? Nathan.

    N 1 Reply Last reply
    0
    • N Nathan Tran

      Hi, I'm developing an irc client add-in for vs.net. On the control hosted by a toolbox window I have various textbox controls. I'm trying to acknowledge when the ENTER key is pressed within a textbox. I've done this before on a winform so I do know how to use the KeyDown, KeyUp, KeyPress events to check for the e.KeyCode == Keys.Return or e.KeyChar == '\r' or e.KeyChar == (char)13. None of these methods work. I have reason to believe that the problem arises from the fact that the textbox is hosted in a CUSTOM control and not a form. From tests I've done, I found out that the textbox does not process the following keys: ENTER, NUMPAD ENTER, CONTROL, ALT, etc...the list goes on. How do I get the textbox to process ENTER key presses? Nathan.

      N Offline
      N Offline
      Nathan Tran
      wrote on last edited by
      #2

      Hi again, A question for people who've worked on vs.net addins: How do I get a handle on the toolbox window that holds the addin control so that I can gracefully destroy it? At the moment, I have to compile/exit vs.net/restart in order to load a new instance of the addin. Also one other peculiarity. I've noticed that I have to load my addin project in order for the actual addin to load (release build). I've have to look into this a little further. Any clue? Nathan.

      W 1 Reply Last reply
      0
      • N Nathan Tran

        Hi again, A question for people who've worked on vs.net addins: How do I get a handle on the toolbox window that holds the addin control so that I can gracefully destroy it? At the moment, I have to compile/exit vs.net/restart in order to load a new instance of the addin. Also one other peculiarity. I've noticed that I have to load my addin project in order for the actual addin to load (release build). I've have to look into this a little further. Any clue? Nathan.

        W Offline
        W Offline
        WizardOfPeyton
        wrote on last edited by
        #3

        I have also been working on a few add-in for VS.Net. I think I can help you with closing your toolwindow. I created a data member called Tool Window in my Connect class private Window ToolWindow; Save the Window returned from the CreateToolWindow(...) call. ToolWindow = applicationObject.Windows.CreateToolWindow(addInInstance, progIdAttributeObj.Value, "Your Tool Window", guidstr, ref objTemp); To destroy the window call the following. I do this in the OnDisconnection(...) method. ToolWindow.Close(EnvDTE.vsSaveChanges.vsSaveChangesYes); I have noticed other issues with ToolWindows, similiar to what happens with the Properties ToolWindow. After debugging the application your working on, the Tool Window does not 'reappear' when debugging is finished. Good Luck.

        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