I did a search on the forum on how to create a scrollable form - but the results were not very helpful.....Please can anyone help me................How do I create a scrollable form?
Originally posted by kinjalgp What exactly are you up to ?
kinhalgp
I have created a form which contain a number of command buttons - these command buttons are within a frame.....a user cannot see all the available buttons unless they actually scroll up/down...
The subclassing method is good but you need to expend some effort to make it work. Unfortunately, I don't remember what machinations I went through. Make sure you d/l and register the correct .dll (there are vb5 and 6 versions). The dll works great for resizing entire forms, but like I said - requires some work. I've also had sporadic issues w/ it when installing on win95 boxes.
Depending on what you're doing, the attached file (scrollbox.zip) may work better for you. (I did not write this control and I can't find where I got it from - so my apologies to the author). I tend to use it to create a scrollable "viewport" on a form - where it works great. In my experience though, it doesn't work too well when used to fill an entire form - scrolls fine but there are some graphics issues which I didn't like on Form_Resize.
Originally posted by Briantcva The subclassing method is good but you need to expend some effort to make it work. Unfortunately, I don't remember what machinations I went through. Make sure you d/l and register the correct .dll (there are vb5 and 6 versions). The dll works great for resizing entire forms, but like I said - requires some work. I've also had sporadic issues w/ it when installing on win95 boxes.
Depending on what you're doing, the attached file (scrollbox.zip) may work better for you. (I did not write this control and I can't find where I got it from - so my apologies to the author). I tend to use it to create a scrollable "viewport" on a form - where it works great. In my experience though, it doesn't work too well when used to fill an entire form - scrolls fine but there are some graphics issues which I didn't like on Form_Resize.
Briantcva
Maybe I am doing something wrong...when I try to load your *.ocx file...I am receiving an error " file cannot be loaded" am I doing something wrong...
Briantcva was kind enough to zip me an *.ocx file so I would be able to scroll my forms. I have referenced the OCX file but as I'm new to VB.....I'm stuck. How do I use this OCX file and its properties?
Briantcva was kind enough to zip me an *.ocx file so I would be able to scroll my forms. I have referenced the OCX file but as I'm new to VB.....I'm stuck. How do I use this OCX file and its properties?
Originally posted by Briantcva The subclassing method is good but you need to expend some effort to make it work. Unfortunately, I don't remember what machinations I went through. Make sure you d/l and register the correct .dll (there are vb5 and 6 versions). The dll works great for resizing entire forms, but like I said - requires some work. I've also had sporadic issues w/ it when installing on win95 boxes.
Depending on what you're doing, the attached file (scrollbox.zip) may work better for you. (I did not write this control and I can't find where I got it from - so my apologies to the author). I tend to use it to create a scrollable "viewport" on a form - where it works great. In my experience though, it doesn't work too well when used to fill an entire form - scrolls fine but there are some graphics issues which I didn't like on Form_Resize.
I this is a great ocx...but can I do something with it as it chnages it height and width according to form resize...
Can u show me some example where u have used this...???
Originally posted by wrack I this is a great ocx...but can I do something with it as it chnages it height and width according to form resize...
Can u show me some example where u have used this...???
Cheers...
I'm a little confused. Are you asking how to set it so it doesn't change size based on Form_Resize (set "Fit to Form" property to False) or how to use when it is maximized?
Attached file is a screenshot of the scrollbox in use. The six "entries" are all placed on the scrollbox control. As those same entries can be in any number for a particular date - the viewport needs to scoll.
I add that control in the form and when I resize the form it doesn't show me the scrollbar...
I added that control and some controls in that control...When I resize that control in runtime it does shows the scrollbar but when I try to resize it in runtime it gets messed up...
Originally posted by wrack I add that control in the form and when I resize the form it doesn't show me the scrollbar...
I added that control and some controls in that control...When I resize that control in runtime it does shows the scrollbar but when I try to resize it in runtime it gets messed up...
Any idea...
So you have Fit to Form = True?
Paste this:
Code:
Private Sub Form_Resize()
Me.ScrollBox1.Refresh
End Sub
And most importantly, DO NOT double click the controls from the toolbox to place them in the scrollbox. Even though they appear to be children of the scrollbox, they are not. Physically draw the controls in the scrollbox and see if that helps.
Originally posted by Briantcva So you have Fit to Form = True?
Paste this:
Code:
Private Sub Form_Resize()
Me.ScrollBox1.Refresh
End Sub
And most importantly, DO NOT double click the controls from the toolbox to place them in the scrollbox. Even though they appear to be children of the scrollbox, they are not. Physically draw the controls in the scrollbox and see if that helps.
Run the program and then resize the form to smaller size...U will see what I am talking about...
You should be able to add a horizontal scrollbar by modifying the code for my horizontal scrollbar. If you give it a try and you have a problem, then I'll try to help.
Originally posted by MartinLiss You should be able to add a horizontal scrollbar by modifying the code for my horizontal scrollbar. If you give it a try and you have a problem, then I'll try to help.
Thanks Martin but I already put the horizontal bar but when I scroll horizontally can't see the half of the combobox...
Private Sub Form_Load()
ScrollBox1.Width = Me.Width
ScrollBox1.Height = Me.Height
ScrollBox1.Refresh
End Sub
Private Sub Form_Resize()
ScrollBox1.Width = Me.Width
ScrollBox1.Height = Me.Height
ScrollBox1.Refresh
End Sub
Now I see what you mean about resizing. So my question is, do you want the scrollbox to fit the entire form? If yes, then set "Fit to Form = True" and don't mess w/ the form load and resize events save for
Code:
Private Sub Form_Resize()
ScrollBox1.Refresh
End Sub
Or am I being a total knucklehead and *still* not getting your problem? Or have you simply given up? FWIW, I think this is an excellent and more elegant control than using the standard VB scrollbars - w/ all due respect to Martin.