Hi
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?
Thanks in advance
;)
Printable View
Hi
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?
Thanks in advance
;)
What exactly are you up to ? :confused:
kinhalgpQuote:
Originally posted by kinjalgp
What exactly are you up to ? :confused:
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...
Hope I have mad myself clear enough.........
Holly
Thanks Briantcva - I will have a lookQuote:
Holly
Nice class, just what I wanted
Does it work in ur PC...???
does't work at my PC...!!!
I think I need a DLL as it says up there...
Can u help me out...
Have you managed to get the class to work. I cannot get it to work.Quote:
Originally posted by CADMANdo
Nice class, just what I wanted
holly
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.
BriantcvaQuote:
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.
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...
Thanks for all your help
Holly
;) ;) ;) ;)
Did you register the ocx before loading?
Oh dear, am I thick or what???????Quote:
Originally posted by Briantcva
Did you register the ocx before loading?
Hi everyone
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?
Thanks in advance
Holly
:confused:
Sorry I have answered my own question!!!!!!Quote:
Originally posted by holly
Hi everyone
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?
Thanks in advance
Holly
:confused:
Thanks
Thanks Briantcva - Your *.OCX file works a treat.
Thanks again for all your help
Holly
;) :) :) :)
I this is a great ocx...but can I do something with it as it chnages it height and width according to form resize...Quote:
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.
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?Quote:
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...
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...
Any idea...
So you have Fit to Form = True?Quote:
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...
Paste this:
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.Code:Private Sub Form_Resize()
Me.ScrollBox1.Refresh
End Sub
Run the program and then resize the form to smaller size...U will see what I am talking about...Quote:
Originally posted by Briantcva
So you have Fit to Form = True?
Paste this:
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.Code:Private Sub Form_Resize()
Me.ScrollBox1.Refresh
End Sub
See the attachment...
I've attached a zip of a project that scrolls a form just using standard VB controls.
Thanks Martin....Quote:
Originally posted by MartinLiss
I've attached a zip of a project that scrolls a form just using standard VB controls.
U reckon u can post one more with Horizontal and Vertical both scrollbar...
Really appreciate that...
Cheers...
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...Quote:
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.
see the attachment plz...
What am I doing wrong or what I am not doing...???
VB Code:
Private Sub Form_Load() picWindow.Left = 0 ' picWindow.Width = Me.Width - VScroll1.Width picWindow.Width = 8535 picI_Scroll.Width = picWindow.Width VScroll1.Height = picWindow.Height VScroll1.Max = picI_Scroll.Height - picWindow.Height VScroll1.SmallChange = 100 VScroll1.LargeChange = picWindow.Height VScroll1.Left = Me.Width - VScroll1.Width - 60 VScroll1.Top = 0 ' HScroll1.Width = picWindow.Width HScroll1.Width = VScroll1.Left ' HScroll1.Max = picI_Scroll.Width - picWindow.Width HScroll1.Max = VScroll1.Left HScroll1.SmallChange = 100 HScroll1.LargeChange = picWindow.Width HScroll1.Left = 0 HScroll1.Top = picWindow.Height picI_Scroll.Left = 0 picI_Scroll.Width = picWindow.Width End Sub
Thanks Martin...really appreciate that...Quote:
Originally posted by MartinLiss
VB Code:
Private Sub Form_Load() picWindow.Left = 0 ' picWindow.Width = Me.Width - VScroll1.Width picWindow.Width = 8535 picI_Scroll.Width = picWindow.Width VScroll1.Height = picWindow.Height VScroll1.Max = picI_Scroll.Height - picWindow.Height VScroll1.SmallChange = 100 VScroll1.LargeChange = picWindow.Height VScroll1.Left = Me.Width - VScroll1.Width - 60 VScroll1.Top = 0 ' HScroll1.Width = picWindow.Width HScroll1.Width = VScroll1.Left ' HScroll1.Max = picI_Scroll.Width - picWindow.Width HScroll1.Max = VScroll1.Left HScroll1.SmallChange = 100 HScroll1.LargeChange = picWindow.Width HScroll1.Left = 0 HScroll1.Top = picWindow.Height picI_Scroll.Left = 0 picI_Scroll.Width = picWindow.Width End Sub
Here's the code I have from your tmp.zip
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 forCode: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
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.Code:Private Sub Form_Resize()
ScrollBox1.Refresh
End Sub