I am using Visual Baisc to create a programme that has two frames and 100 text boxes (99 of which are created at run time.) The first frame is ProductFrame and the second is called InnerFrame (which sits inside Product Frame). My problem is that when I scroll with the scroll bar, the frame moves and not the contents. How do I make the contents move and not the Frame? Text1(0) has been drawn on the frame. My code is below:
Private Sub Form_Load()
Dim i, previousI As Integer
' VScroll.Max = 200
' cmboCount / 15
' VScroll.Min = 0
' VScroll.Top = 0
' VScroll.Left = InnerFrame.Width
' VScroll.Height = InnerFrame.Height
' VScroll.Visible = True
noItems = 100
For i = 1 To noItems
Load Text1(i)
Set Text1(i).Container = InnerFrame
perviousI = i - 1
newTop = Text1(perviousI).Top + 300
Text1(i).Top = newTop
Text1(i).Visible = True
Text1(i).Text = i
Next
Set InnerFrame.Container = productsFrame
End Sub
Private Sub VScroll_Change()
Dim tempInt As Integer
tempInt = 20
' productsFrame.Top = -tempInt * VScroll.Value
InnerFrame.Top = -tempInt * VScroll.Value
' InnerFrame.Top = -VScroll.Value
' Move InnerFrame.Top - tempInt
' Move productsFrame.Top = tempInt * VScroll.Value
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Unload Me
customerRecords.Close
For i = 1 To noItems
Unload Text1(i)
Next
' End
End Sub
Private Sub Form_Load()
Dim i, previousI As Integer
' VScroll.Max = 200
' cmboCount / 15
' VScroll.Min = 0
' VScroll.Top = 0
' VScroll.Left = InnerFrame.Width
' VScroll.Height = InnerFrame.Height
' VScroll.Visible = True
noItems = 100
For i = 1 To noItems
Load Text1(i)
Set Text1(i).Container = InnerFrame
perviousI = i - 1
newTop = Text1(perviousI).Top + 300
Text1(i).Top = newTop
Text1(i).Visible = True
Text1(i).Text = i
Next
Set InnerFrame.Container = productsFrame
End Sub
Private Sub VScroll_Change()
Dim tempInt As Integer
tempInt = 20
' productsFrame.Top = -tempInt * VScroll.Value
InnerFrame.Top = -tempInt * VScroll.Value
' InnerFrame.Top = -VScroll.Value
' Move InnerFrame.Top - tempInt
' Move productsFrame.Top = tempInt * VScroll.Value
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Unload Me
customerRecords.Close
For i = 1 To noItems
Unload Text1(i)
Next
' End
End Sub