Click to See Complete Forum and Search --> : Can't build control...


RichardH
February 3rd, 2000, 08:26 AM
I'm trying to build an ActiveX control which will be a more 'useful' combobox.

I've got a text-box, command button and msflexgrid all working nicely in perfect harmony...

The problem is that because the grid and usercontrol windows are children (e.g: WS_CHILD) the grid never displays outside the form on which it's put. (put an ordinary combo box near the bottom of a form, drop down the list portion and you'll see what I mean...)

I can't seem to remove the WS_CHILD style on the grid by any means once the window is created. I've tried using SetParent to set the grid window as a child of the main desktop - this positions the window fine - but now half the events are not firing!!! ARGGGHH!!!! What I expect I need is to keep the grid window 'owned' by the form - but not allow it to be a 'child' of the form.

Any bright ideas?

(If any smart arses say 'just write the thing in C++!' - I probably will one day - but that doesn't help me at work where VB is our only development language..)

Chris Eastwood
February 3rd, 2000, 09:01 AM
I'd recommend you take a look over at http://vbaccelerator.com. There's some excellent code there, including a class that you can use to make any control a proper popup window (see http://vbaccelerator.com/codelib/ddtoolwn/ddtoolwn.htm for the code in question)


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

RichardH
February 8th, 2000, 11:13 AM
Thanks for the tip.

I had a glance at that site - there's come nice material there but I decided to keep going and solve the problem myself. It now works nicely.

Thanks again - Richard.