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
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.
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
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.
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
Re: listbox display out of a frame
Not sure I understand. Can you show some image of what you speak, please.
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
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.
Re: listbox display out of a frame
VB Code:
Dim lngWidth As Long
Dim lngLongest As Long
Dim lngIndex As Long
lngWidth = List1.Width
'see what the longest entry is
For lngIndex = 0 To List1.ListCount - 1
If Len(List1.List(lngIndex)) > Len(List1.List(lngLongest)) Then
lngLongest = lngIndex
List1.Width = Me.TextWidth(List1.List(lngIndex) + Space$(5))
End If
Next lngIndex
Frame1.Width = Frame1.Width + (List1.Width - lngWidth)
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).
Re: listbox display out of a frame