CoNFuCiOuS
02-17-2002, 04:36 PM
hey, I'm making a little mp3 player with a playlist, with a listbox on it. my problem is, the listbox snaps to every 15 pixel or whatever, so it looks really messy when I resize the form. is there any way to make the form snap to every 15 pixels when it is sized? if you don't know what I mean, check out winamps playlist.
thanks:D
ChiefRedBull
02-17-2002, 05:01 PM
Erm... can't you just adjust the form relative to the listbox?
ListBox.Height = 50
Form.Height = ListBox.Height + 15
:confused:
CoNFuCiOuS
02-17-2002, 09:41 PM
well, I could, I geuss, but it would look really choppy, and would skip back and forth between the size it should be and the size u set it to....get what I mean?
I use subclassing like this to control the form minimum and maximum size:
function Subclass(hwnd,msg,ect..)
dim minmax as MINMAXINFO
if msg = WM_GETMINMAXINFO then
copymemory minmaxinfo, byval lparam, len(minmaxinfo)
set the min and max size in the user defined type minmaxinfo
copymemory byval lparam, minmaxinfo, len(minmaxinfo)
endif
end sub
is there some little trick like this for WM_SIZE?
cuz I checked, lparam is not 0
I tried copying it to a pointapi but vb just crashed:eek:
any help would be appreciated;)
thanx:D
dcl3500
02-17-2002, 10:31 PM
Originally posted by CoNFuCiOuS
well, I could, I geuss, but it would look really choppy, and would skip back and forth between the size it should be and the size u set it to....get what I mean?
You mean kinda like winamp does? :)
Couldn't you in the form_resize event limit the form size to numbers that are evenly divisible by 15? Offhand I don't have any code to do this, but I reckon I could whip something up tommorrow sometime if you need a hand doing it.
CoNFuCiOuS
02-18-2002, 11:10 AM
heh, as if it wasn't enough of a problem, I just checked and it snaps to every 13 pixels..not 15 :(
I think I might just make my own listbox control without that snaping function.
I probably won't start right away, so if anyone can find a solution withing a few days I will be very happy :D
thanx!
dcl3500
02-18-2002, 11:33 AM
Hey just thought of something for you to think about too.
Try setting the font size of the listbox larger and smaller and see what the snap-size at those different fontsizes. That is the reason (I think) the listbox snaps to particular sizes. To keep at least a certain portion of the last list item visible.
So, basically what I am saying is even if you do limit the form/listbox to certain increments as soon as you change the font point size you need to recalculate the increment size again.
Garrett Sever
02-18-2002, 11:54 AM
I might be totally nuts here, but isn't there a "IntegralHeight" property on a listbox that lets you resize smoothly?
CoNFuCiOuS
02-18-2002, 01:17 PM
hand...yer right...:-\
I just took a quick look through all the properties...must have missed it...
oh well..thanx:)
thx to dcl too..:cool: