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. Windows Forms
  4. How to implement an intellisense style popup window?

How to implement an intellisense style popup window?

Scheduled Pinned Locked Moved Windows Forms
visual-studiocsharptutorialquestion
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.
  • P Offline
    P Offline
    prabbit2010
    wrote on last edited by
    #1

    hi all, In Visual studio's code editor, when the intellisense window pops up, the focus always remains on the editor window (instead of jumping to the popup window, I think this could have been handled by a SetWindowPos call with SWP_NOACTIVATE), what has puzzled me so much is that if you mouse-click an item or even drag the vertical scroll bar on the popup window, the focus still remains, the cursor flashes at the last character you have typed. How is that possibly done?

    L 1 Reply Last reply
    0
    • P prabbit2010

      hi all, In Visual studio's code editor, when the intellisense window pops up, the focus always remains on the editor window (instead of jumping to the popup window, I think this could have been handled by a SetWindowPos call with SWP_NOACTIVATE), what has puzzled me so much is that if you mouse-click an item or even drag the vertical scroll bar on the popup window, the focus still remains, the cursor flashes at the last character you have typed. How is that possibly done?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The trick is to set the focus back to the text control after the code completion window is shown and after scroll bar value changes.

      //Code Completion Form

      Control _parent = null;

      void Show(Control parent) {
      this.Show();
      _parent = parent;
      _parent.Focus();
      }

      void ScrollValueChanged(.....) {
      _parent.Focus();
      }

      P 1 Reply Last reply
      0
      • L Lost User

        The trick is to set the focus back to the text control after the code completion window is shown and after scroll bar value changes.

        //Code Completion Form

        Control _parent = null;

        void Show(Control parent) {
        this.Show();
        _parent = parent;
        _parent.Focus();
        }

        void ScrollValueChanged(.....) {
        _parent.Focus();
        }

        P Offline
        P Offline
        prabbit2010
        wrote on last edited by
        #3

        thank you Shameel. I think this is a good solution, but not a perfect one. And i don't think Microsoft Visual Studio team has done this by this means. Seems the popup window can never be activated, by that I mean either the window is of WS_EX_NOACTIVATE style or it responds WM_MOUSEACTIVATE by MA_NOACTIVATE. I made some test code on this using Winform. The popup window was made by a Form window hosting a ListBox window, I overrided the CreateParam to append the WS_EX_NOACTIVATE style for both two windows, I also overrided WndProc to make them respond WM_MOUSEACTIVATE by MA_NOACTIVATE. But all these didn't work:^^( Maybe I have misunderstood WS_EX_NOACTIVATE or WM_MOUSEACTIVATE?

        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