PDA

Click to See Complete Forum and Search --> : ActiveX ZOrder


awadey
Mar 14th, 2002, 09:45 AM
Hello,

Anybody know of a way that I can force a control within my usercontrol to the front of the screen?

Basically I am displaying a listview on click of a button (displays the same as a combobox would). I need to ensure the whole control does not get the highest ZOrder, as the listview will sometimes need to be longer than the associated textbox and button (as a combo), and I do not want the rest of the control (by the button) to overlap any other controls next to it!

Cheers

Alec.

Edneeis
Mar 14th, 2002, 10:19 AM
I think you'd just use the listbox's Zorder. Worked for me. I just got done (well mostly) with a combo box control if you want the code I can kick down.

awadey
Mar 18th, 2002, 02:39 AM
Sorry for the late response, the code would be fantastic, I am tearing my hair out here!!!

Cheers,

Al

Edneeis
Mar 18th, 2002, 03:27 AM
Sure it's already posted here:

http://www.vbforums.com/showthread.php?s=&threadid=152163

awadey
Mar 18th, 2002, 06:03 AM
Fantastic, cheers for the quick response.

Your code has certainly moved me nearer to completion. However, the associated textbox seems to still have focus (I can't trap the keypress event on the listview anymore). I need to let the user select an item in the list using the up and down arrows, but obviously with the textbox having focus, I haven't managed it!

Any further ideas?

Edneeis
Mar 18th, 2002, 10:20 AM
You could use SetCapture to make the listbox receive the MouseUp&Down events of the Textbox but that might open a whole new can of worms.

Actually now that I think abou tit can't you just use the textbox Mouse Events and forward them to the listbox:

Public Sub Text1_MouseUp(Shift as integer...)
List1_MouseUp(Shift,Button...)
End Sub

Something like that.

Edneeis
Mar 18th, 2002, 11:45 AM
I added that feature to my combo, here you go if you want to see how I did it, although I'm sure there are more ways.

awadey
Mar 19th, 2002, 02:46 AM
That's great, cheers