Greggory
asked on
Dynamically Create Textboxes, and Form Scrolling?
I have a program that asks for the number of transaction that happened. I would like it to be able to handle most situtations, but I don't know how many input boxes to have by default. More than likely, it will never be more than 10. I found a form scrolling sample and added rows of text boxes. I then made the text boxes invisible and changed the form scrolling thing to only check visible controls. That way, when the text boxes are invisible, the scroll bar goes away. The problem is, with many text boxes, the scrolling is slow and choppy. Some controls scroll up faster than others, so the form gets distorted a little. Is there a way to dynamically create text boxes when they are needed or is there a better way to get as many as I need?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As a sidenote you would probably be better off using a FlexGrid control.
Then you don't have to worry until i think 65K entries.... Never hit the limitation using it.
Then you don't have to worry until i think 65K entries.... Never hit the limitation using it.
Private WithEvents txtNew As VB.TextBox
Private Sub cmdNewUpDown_Click()
Set txtNew = Controls.Add("VB.TextBox",
txtNew.Text = "New TextBox"
txtNew.Visible = True
End Sub
Private Sub txtNew_KeyPress(KeyAscii As Integer)
KeyAscii = KeyAscii - 1
End Sub