hi.. friends..
i hav created a new form!! 4 my project but i need a horizontal scroll bar to be attached to it so that i can add more no sections.. to right side of the form!! 15360*11520 is the default size of the form!! i want to increase the size of the form!! how to do it..
plzzzzzzzzzz help!!
Regards
yopirates :)

hi.. friends..
i hav created a new form!! 4 my project but i need a horizontal scroll bar to be attached to it so that i can add more no sections.. to right side of the form!! 15360*11520 is the default size of the form!! i want to increase the size of the form!! how to do it..
plzzzzzzzzzz help!!
Regards
yopirates :)

Change the form.height and form.width values

Besides Walt's advice, it sounds like you want to make your form scrollable via the use of a horizontal scrollbar. The easiest thing to do, would be to put all your controls into a picture box except the scrollbar. Then you could use the change event of the scrollbar to change the left value of the picture box instead of having to enumerate through each control and changing its left property. Of course, during design time a picture box also makes it easer to design the off screen area of the contents of the picture box as you can just drag it around... Now, if you don't like the sunken effect of the picture box, you can change its appearance property to flat, but if you do that, you will need to also change it backcolor property back to buttonface.

Good Luck

@ walt!! hi.. walt thanks for ur advice but i'm not able.. 2 change the values!! in the form property.. under categorized!! there's one option postion.. i changed.. the vaules of height and width!! it says!! " FORM CANNOT BE CHANGED WHIL MINIMIZED OR MAXIMIZED" .. SO.. HOW 2 DO ABT IT..

So then your windowstate property is set to vbmaximized... Use the picture box with the scroll bar(s) outside of the pic box and you should be fine...

Good Luck

do u mean i hv to put in the table inside a picture box and use the scroll bar outside the picture box???

do u mean i hv to put in the table inside a picture box and use the scroll bar outside the picture box???

You have been asked to read the Member Rules multiple times. Read them. You're about to get an infraction for Keep It Clean this time -- 1st paragraph.

Your form is MAXIMIZED -- it's set to fill the screen. You cannot make a form bigger than the screen if it's set to fill it. If the form is set as a WINDOW, you can make it bigger than the screen.

But consider -- is making the form larger than the screen a good idea? Would it be better to have multiple forms? Or maybe TABs?

u need a scrollable form, hmmmm i think if you used one mdi form and your form as a parent form then you can add or change the height or width to 50,000 or more !

But i think it will work without mdi form. By changing the form border to none then i think you can adjust the form height or width as u like. If you used a mdi form then it will automatically create a scroll bar !!.

Okay, start a new standard exe project and add the following to form1... 2 textboxes (text1, text2), 2 picture boxes (picture1, picture2), vertical scrollbar (VScroll1), horizontal scrollbar (HScroll1), and then add the code...

Option Explicit

Private Sub Form_Load()

VScroll1.Move Me.ScaleWidth - (VScroll1.Width + 30), 30, VScroll1.Width, Me.ScaleHeight - 60
HScroll1.Move 30, Me.ScaleHeight - (HScroll1.Height + 30), Me.ScaleWidth - (60 + Me.ScaleWidth - VScroll1.Left)
Picture1.Move 30, 30, Me.ScaleWidth - (60 + (Me.ScaleWidth - VScroll1.Left)), Me.ScaleHeight - (60 + (Me.ScaleHeight - HScroll1.Top))
Set Picture2.Container = Picture1
Picture2.Appearance = 0
Picture2.Move 0, 0, Picture1.Width * 2, Picture1.Height * 2
Picture2.BackColor = vbButtonFace
Set Text1.Container = Picture2
Text1.Move 30, 30
Text1.Text = "Left side top"
Set Text2.Container = Picture2
Text2.Move Picture2.Width - (Text2.Width + 60), Picture2.Height - (Text2.Height + 60)
Text2.Text = "Right side bottom"
VScroll1.Min = 0
VScroll1.Max = Picture1.Height
VScroll1.Value = 0
VScroll1.SmallChange = 30
VScroll1.LargeChange = 300
HScroll1.Min = 0
HScroll1.Max = Picture1.Width
HScroll1.Value = 0
HScroll1.SmallChange = 30
HScroll1.LargeChange = 300

End Sub

Private Sub HScroll1_Change()
Picture2.Left = (HScroll1.Value * -1)
End Sub

Private Sub VScroll1_Change()
Picture2.Top = (VScroll1.Value * -1)
End Sub

Now, the above was designed on a vista home machine and for the most part should look good on any system but if it does not then you may have to calculate the forms borders by subtracting width/height - scalewidth/scaleheight...

Also, you will need to do different calculations for your horizontal scrollbar depending upon the width of the picture box you eventually use.

And finally, you could use Vineeth k's solution to create a scrollable form for you...

Good Luck

hiii... vb5prgmr..
this is the form which i have created..
and here is the screen shot!!
http://img682.imageshack.us/img682/7029/31102884.jpg
and here.. i have created.. a table kind of thing upto.. 10ghz!! i wat it to extend upto.. 18ghz!! the things which u told.. were working.. after running the form.. i am not able to get.. as how to implement.. that while i am designing my form.. before running???

That would be borderstyle... and for your inquiry about my code... What you would do presently, is to copy (CTRL+X) all the controls from the form, add the picture box, and paste the control into the picture box (CTRL+V). Then you could resize the picture box as needed, but like I said earlier (or maybe thought???), K's solution would be easier and to use K's solution you would add a MDI parent form, make your present form mdichild=true in properties at design time, delete its caption, controlbox=false, and border style to none.

Good Luck

hi.. vb5prgmr.. i hav pasted my form contents.. in a picture box!! in a new form.. then i changed caption, controlbox=false, and border style to none.. then.. i added horizontal and vertical scroll.. bars.. then.. i coudn't know.. how to go.. further.. plss.. assist mee.. regarding this..

See my example, especially the form load code. You can reduce or even eliminate most of that code by setting up your form correctly. (Hint: See the set control.container = control for more...).

Good Luck

I think the easiest way is to use a MDI form, just insert one mdi for and check your form and make it its child form. Then change its border style, height and width.
It will automatically create scroll bars. I think its better, no coding for that !

hi.. vineeth.
thanks!!!!!!!!!! a lot..!!! it's workin!!!!!!!!! :) :) :)
thanks.. sooooooooooo much!!!!!

This article has been dead for over six months. Start a new discussion instead.