CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Location
    Leeds, UK
    Posts
    9

    Can't build control...

    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..)


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Can't build control...

    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

  3. #3
    Join Date
    Nov 1999
    Location
    Leeds, UK
    Posts
    9

    Re: Can't build control...

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured