Is there anyway I can exceed the vscrollbar.max value of 32767

By kw_ng ·
I have developed programme to create new controls during runtime using VB6.0. The user can create new controls which has a row of labels and textboxes to capture some info from user. The user can create new rows of labels and textboxes to capture more info of similar category. As these rows increase, the form cannot cater them for viewing so I contain all the controls in a picturebox. I then created a scrollbar which has these codings.

outerfrm_Scaleheight = outerfrm.ScaleHeight = 100
framecon_Scaleheight = framecon.ScaleHeight = 100

If CounterTB(new_index).Text > 3 Then
framecon.Height = framecon.Height + 1455
VBar.Enabled = True
VBar.Visible = True
VBar.Min = 0
VBar.Max = framecon.Height - outerfrm.Height
VBar.LargeChange = 10000 'framecon_Scaleheight
VBar.SmallChange = 2000 'framecon_Scaleheight / 5

End If

Everything works fine but when I add rows of new controls, I can only go up to 26 rows where I will then have a VBar.Max will exceed 32767. This will cause an overflow error. I would appreciate very much if anyone has any idea on how to solve this limitation.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

No but you could try

by Tony Hopkinson In reply to Is there anyway I can exc ...

Starting it at -32768. That the minimum for a two byte integer.
Long time since I use VB6, so I'm not sure about that one.
As a PS I'd never try and code up an interface like this, can't see my users being impressed with it on a usability front.

Have you thought about using a grid? aside from dealing with this issue, the coding would be a lot simpler as well. MSHFlexgrid or it's cousins should do the job.

Collapse -

I am trying but it's odd

by kw_ng In reply to Is there anyway I can exc ...

Hi. Thanks for your reply. However, I am baffled when I noticed some difference between my PC (AMD 64bit but 512 Mb RAM) at my office and my home PC (P4 and 768 Mb).
As mentioned the vscrollbar is used to scroll the rows of controls that I have created during runtime. I managed to create 26 rows using my office PC but I can create 46 rows of it using my PC before overflow error came up. Any idea?

Collapse -

Off the top of my head

by Tony Hopkinson In reply to I am trying but it's odd

Related Discussions

Related Forums