http://www.csdn.net/expert/topic/807/807724.xml?temp=.6121179

解决方案 »

  1.   

    你可以在设置子窗口的GetFocus中写上激活它的父窗口,使它的父窗口再得到焦点就可以了,不过这样还是要有一个闪动的过程的,即子窗口得到焦点再失去焦点的过程,这个办法不是很好.更好的办法我还没想到.
      

  2.   

    http://www.csdn.net/expert/topic/911/911070.xml?temp=.6207849
      

  3.   

    以前巴顿写的,虽然不是这种类型的,但有点参考价值
    http://www.csdn.net/expert/topic/480/480348.xml?temp=.4831507这是一个用TextBox作弹出式菜单的程序:
    http://www.mvps.org/vbvision/_samples/PopUp_Listbox_Demo.zipPopUp Listbox Demo.zip (35KB)
      This project shows how you can create a popup virtual listbox similar to the one used for VB's intellisense in the IDE.  It is based on Matt Hart's concept of hooking the WM_CREATE message for VB controls to enable changing window styles that can only be set when a control is created.  This technique was published in the July, 1999 issue of the VBPJ.  I have taken the concept a step further and encapsulated it in a user control.  The listbox is also "virtual" in the sense that the items it displays are actually kept in a separate array.  The list only calls for the text of an item when it needs to be drawn.  This is very useful for situations where you have a large number of items that would require a long time to load into a regular listbox.  This demo uses subclassing techniques so, If you don't already have it, you will want to get the Debug Object (Dbgwproc.dll) DLL to allow stepping through subclassed code in break mode in the VB IDE.