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.