Discussion:
scroll bars on a form
(too old to reply)
BIAF
2004-08-07 02:29:33 UTC
Permalink
Can you set scroll bars on, on a form using vbdos? Dont see scrollbars
/true/false option.
Derek Ross
2004-08-07 06:50:22 UTC
Permalink
Post by BIAF
Can you set scroll bars on, on a form using vbdos? Dont see scrollbars
/true/false option.
It works a bit differently. You need to add a Vertical and/or
Horizontal Scrollbar control to the form and then set the Scrollbar
control's Attached property to True (-1).

Cheers

Derek
BIAF
2004-08-07 19:18:45 UTC
Permalink
thx, hope you dont mind all the questions, i figer'd that its not that
busy here i should keep them coming :)
Post by Derek Ross
Post by BIAF
Can you set scroll bars on, on a form using vbdos? Dont see scrollbars
/true/false option.
It works a bit differently. You need to add a Vertical and/or
Horizontal Scrollbar control to the form and then set the Scrollbar
control's Attached property to True (-1).
Cheers
Derek
BIAF
2004-08-08 18:18:43 UTC
Permalink
OK, have them scroll bars attached to form and visible, but i take it
theres alot more to do ,

un-like vb6.0 , seems that in vbdos, when i make form smaller than
it's content, the scroll bars dont seem to work, like they don't
relize theres content there to be scrolled.

Do i have to set up some code to move the areas?

thx
Post by Derek Ross
It works a bit differently. You need to add a Vertical and/or
Horizontal Scrollbar control to the form and then set the Scrollbar
control's Attached property to True (-1).
Cheers
Derek
Derek Ross
2004-08-08 19:42:37 UTC
Permalink
Post by BIAF
thx, hope you dont mind all the questions, i figer'd that its not that
busy here i should keep them coming :)
Too right! That's what the group is for and if no one else is using
it, you might as well make the most of it.

Cheers

Derek
BIAF
2004-08-10 16:27:53 UTC
Permalink
OK, have them scroll bars attached to form and visible, but i take it
theres alot more to do ,

un-like vb6.0 , seems that in vbdos, when i make form smaller than
it's content, the scroll bars dont seem to work, like they don't
relize theres content there to be scrolled.

Do i have to set up some code to move the areas?

thx
Bob O`Bob
2004-08-10 18:13:33 UTC
Permalink
Post by BIAF
OK, have them scroll bars attached to form and visible, but i take it
theres alot more to do ,
un-like vb6.0 , seems that in vbdos, when i make form smaller than
it's content, the scroll bars dont seem to work, like they don't
relize theres content there to be scrolled.
No, VB6 forms have never done anything of the sort.
Post by BIAF
Do i have to set up some code to move the areas?
Yes, you have to include code.



Bob
BIAF
2004-08-11 20:31:40 UTC
Permalink
I have attached scroll bars to form, and this 'VScroll1' works fine,
it will move the 4 picture boxes i have up and down all togeather and
still lay'd out side by side.



SUB VScroll1_Change ()
FOR j% = 0 To 3
picBoxes(j%).top = (VScroll1.Value / 100) * ScaleWidth
NEXT j%
END SUB


But when I try to recreate this sub for the 'HScroll1' (left to
right/right to left)

FOR k% = 0 TO 3
picBoxes(k%).Left = (HScroll1.Value / 100) * ScaleWidth
NEXT k%


What happons above is, when i click on the HScroll on form, it does
move the boxes the way i want (left to right/right to left) but this
time they are all on top of each other. I cant understand how the
first sub (VScroll1) can move them up n down fine and keep them all
side by side but then when i try it with the HScroll sub, it makes the
picboxes over lap each other but still move fine!,

I have also the values set for the scrollers in from load :

********( formload )
VScroll1.max = 100
VScroll1.SmallChange = 1
VScroll1.LargeChange = 20
'
HScroll1.max = 100
HScroll1.SmallChange = 1
HScroll1.LargeChange = 20
******( formload )


any idea as why the 'Hscroll1 sub' is not keeping the picboxes side by
side like the VScroll1 is when moving the boxes up and down?

Thanks.
Derek Ross
2004-08-13 05:17:29 UTC
Permalink
Post by BIAF
I have attached scroll bars to form, and this 'VScroll1' works fine,
it will move the 4 picture boxes i have up and down all togeather and
still lay'd out side by side.
SUB VScroll1_Change ()
FOR j% = 0 To 3
picBoxes(j%).top = (VScroll1.Value / 100) * ScaleWidth
NEXT j%
END SUB
But when I try to recreate this sub for the 'HScroll1' (left to
right/right to left)
FOR k% = 0 TO 3
picBoxes(k%).Left = (HScroll1.Value / 100) * ScaleWidth
NEXT k%
What happons above is, when i click on the HScroll on form, it does
move the boxes the way i want (left to right/right to left) but this
time they are all on top of each other. I cant understand how the
first sub (VScroll1) can move them up n down fine and keep them all
side by side but then when i try it with the HScroll sub, it makes the
picboxes over lap each other but still move fine!,
The problem is that ScaleWidth is not a VBDOS form property. So VBDOS
treats ScaleWidth as a variable with value zero. This doesn't matter
for your VScroll routine since it was really the ScaleHeight that you
should have been using (except that VBDOS forms don't have
.ScaleHeight, they just have .Height) but it does matter for your
HScroll routine. The property you want is .Width not .ScaleWidth.
Either that or you will have to set the variables ScaleHeight and
ScaleWidth to have the appropriate sizes for the form before you use
them.


Cheers

Derek
BIAF
2004-08-14 15:27:45 UTC
Permalink
derek, thanks for the detail'd help,

I play'd around more with this, and tho the scale/width/height thing
makes sence, i still could'n understand why even if i got rid of the
scroll bars TOTALY off the form then just make a command button with a
wee + 1 to move the pics 'left' to test only, i still got the picboxes
overlaping each other and not side by side, so I took the code that
sets out the picture boxes on the array sub and sorta inbeded it like
this into the HScroll1 sub


SUB HScroll1_Change ()
FOR k% = 0 TO drvMedia.listcount - 1
picDrives(k%).Left = (k%) * 9 + 1 + (HScroll1.Value / 100) * Width
NEXT k%
END SUB

the ' (k%) * 9 + 1 ) ' part made the pictures stay side by side as
they moved(with a space between them), tho im still not sure y i dont
need this also in the VScroll1 heehhee newbes eh?, well it works now
thanks to you,

Cheers,
Post by Derek Ross
Post by BIAF
SUB VScroll1_Change ()
FOR j% = 0 To 3
picBoxes(j%).top = (VScroll1.Value / 100) * ScaleWidth
NEXT j%
END SUB
But when I try to recreate this sub for the 'HScroll1' (left to
right/right to left)
FOR k% = 0 TO 3
picBoxes(k%).Left = (HScroll1.Value / 100) * ScaleWidth
NEXT k%
What happons above is, when i click on the HScroll on form, it does
move the boxes the way i want (left to right/right to left) but this
time they are all on top of each other. I cant understand how the
first sub (VScroll1) can move them up n down fine and keep them all
side by side but then when i try it with the HScroll sub, it makes the
picboxes over lap each other but still move fine!,
The problem is that ScaleWidth is not a VBDOS form property. So VBDOS
treats ScaleWidth as a variable with value zero. This doesn't matter
for your VScroll routine since it was really the ScaleHeight that you
should have been using (except that VBDOS forms don't have
.ScaleHeight, they just have .Height) but it does matter for your
HScroll routine. The property you want is .Width not .ScaleWidth.
Either that or you will have to set the variables ScaleHeight and
ScaleWidth to have the appropriate sizes for the form before you use
them.
Cheers
Loading...