Results 1 to 11 of 11

Thread: listbox display out of a frame (resolved)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    listbox display out of a frame (resolved)

    hi i have a list box within a frame and i make the list box flexible in such a way that the sizes varies depending on the data contains inside. But if the list box is larger than the frame it is blocked. How do i make the listbox showing the full display ie out of the frame? thank you.

    Regards,
    Goh
    Last edited by Goh; Jun 29th, 2005 at 09:27 PM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: listbox display out of a frame

    You'd have to resize container (frame in your case) or use combobox instead - dropdown portion can go beyond parent container's boundaries.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    Re: listbox display out of a frame

    yes you are right the drop down comes with the scrollbar of the listbox which is still within the frame. but i would like to length the box (.width base on the data contains) how do i resize the frame?. it is suppose to be fixed. do u mean i will resize the frame as and when the listbox is adjusted to a certain size?


    Regards,
    Goh

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: listbox display out of a frame

    Quote Originally Posted by Goh
    ... do u mean i will resize the frame as and when the listbox is adjusted to a certain size?
    That is exactly right. The problem you may have is the fact that list may get pretty long so your listbox and as a result you may run out of space so using combobox is much cleaner way.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    Re: listbox display out of a frame

    one more question, is it possible to make a line as similar to a default frame (as in the display) thanks

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: listbox display out of a frame

    Not sure I understand. Can you show some image of what you speak, please.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    Re: listbox display out of a frame

    sorry i will explain again.. i

    i got a new form and i put a frame and a line . am i able to change the line in such a way that the line looks the same as the frame? the looks i mean

  8. #8
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: listbox display out of a frame

    Oh, ok ...
    Wel, you may do that by using two lines:
    - draw first line and set BorderWidth = 2 and BorderColor = Button Shadow
    - draw another line and set BorderWidth = 1 and BorderColor = Button Highlight
    - move second line over first and see the effect.

  9. #9
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: listbox display out of a frame

    VB Code:
    1. Dim lngWidth As Long
    2.     Dim lngLongest As Long
    3.     Dim lngIndex As Long
    4.    
    5.     lngWidth = List1.Width
    6.     'see what the longest entry is
    7.     For lngIndex = 0 To List1.ListCount - 1
    8.         If Len(List1.List(lngIndex)) > Len(List1.List(lngLongest)) Then
    9.             lngLongest = lngIndex
    10.             List1.Width = Me.TextWidth(List1.List(lngIndex) + Space$(5))
    11.         End If
    12.     Next lngIndex
    13.     Frame1.Width = Frame1.Width + (List1.Width - lngWidth)

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: listbox display out of a frame

    Also, you can use frame control itself by setting its caption to "" and Height (or Width) = 30 (or close to 30).

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    Re: listbox display out of a frame

    thanks man !

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