Listbox control visibility beyond the extents of a container frame

Discussion in 'AutoCAD' started by petersciganek, Jul 8, 2004.

  1. Hello VB experts:

    I am working on a dialog in VB6 that includes a number of listbox controls with the style set to checkbox. These, in turn, are contained in frames. Because I need to save space – I have the listboxes set display a single line when not in focus and to expand to the height required to view all of the list items when the control receives focus – essentially a drop down check list. This works well, unless the list expands beyond the limits of the frame – displaying only the part of the list within the frame. I would prefer not to change the dimensions of the frame – this would be distracting. Switching list control’s container back and forth from the frame to the form would be a last resort but seems like a lot of overhead. Does anyone know of a means to display a listbox beyond the extent of its container – essentially to behave as a combobox does? Or does anyone have a more elegant solution to displaying multiple select lists? Any leads or help would be greatly appreciated,

    Peter
     
    petersciganek, Jul 8, 2004
    #1
  2. petersciganek

    wivory Guest

    I love a design challenge!

    For some time I could only come up with the two solutions you already stated. But then I thought of another one: you could fake the frame using the line control.

    With a bit of study and experimentation I found that a frame's border consists of two lines, a dark one whose System color is Button Shadow (&H80000010&) and a light one 10 pixels down and right from the first whose System color is Button Highlight (&H80000014&). Simply arrange 4 pairs of these in a box shape, drop a label over the top-left for your frame caption, and voila! Now all your listboxes really will have the form as a container and they'll drop down over the top of the "frame".

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jul 9, 2004
    #2
  3. petersciganek

    wivory Guest

    Even simpler, use two Shape controls in the same manner.

    Regards

    Wayne
     
    wivory, Jul 9, 2004
    #3
  4. Thank you for this solution Wayne -

    I guess that I'm lazy - everything in this dialog is created dynamically - and I was using the frames to group objects (i.e. - get a control's group from its container rather than saving this in a public variable or requerying the database). So the frame plays both a visual and a programmatic role. If I need a similar list checkbox in a fixed dialog I will certainly use your suggestion.

    I currently have the listbox mouseover event expand the listbox and the frame mouseover event reset the listbox - and transfer the listbox container from the form to the frame as necessary. Of course, the problem now is the extent of the form - which I will have to deal with sooner or later...

    Peter
     
    petersciganek, Jul 9, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.