7 Years
Discussion Span
Last Post by P.manidas
Private Sub CmdLoadTextBox_Click()
Dim TopPosition As Integer

NoOfControl = Val(Trim(Text1.Text))

    TopPosition = 3000

    For A = 1 To NoOfControl Step 1
        'Here i want to create an object variable (How many, it will depend on
        '"NoOfControl" variable)
        Set TxtBox = Me.Controls.Add("vb.TextBox", "TxtBox" + Trim(Str(A)))
        'And here i want to place object(textbox) into new object variable
        'newobjectvariable = object variable (Textbox)
        With TxtBox
            .Left = 3000
            .Top = TopPosition
            .Width = 1000
            .Height = 500
            .Visible = True
            .DragMode = 0
        End With
        TopPosition = TopPosition + 1000
    Next A

End If

End Sub

Dear JX Man,

I have posted the sample codes where/why i need the new object variable and storing the object variable into an object variable. Please see my comments on the codes.

I think this information will be enough for you. Thanks for replying sir and waiting

Edited by P.manidas: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.