Adding Text boxes on run time
I created a control array on a text box. I have one during design time. What I am trying to do is when a user clicks the add command button, another box will display below the text box. I can't seem to get the code straight. I will be able to get it to display if I iterate through the control array. What I am trying to do is to pass the parameters of the previous text box top position and the index to the sub routine so I can just load one text box. Here is my code below. I appreciate whatever help you can give.
Thanks
txtFlightDepartDate is the object and 0 should be the index. I have to figure out to how to get the index property of the text box at run time.
Call LoadControls(Me.txtFlightDepartDate,0)
Here is the sub routine I pass the parameters to.
Public Sub LoadControls(obj As Object, intCounter)
intmaxidx = intCounter + 1
obj(intmaxidx).Top = obj(intCounter).Top + _
(obj(intCounter).Index * 400)
obj(intmaxidx).Visible = True
Load obj(intmaxidx)
End Sub
|