hi guys,

i am doing a project on vb, now the issues is i am not able to retrive the data from the textbox which in created during runtime. i created 5 textboxes in runtime, i enter the datas for each textbox, but i couldnt read the same. can anyone help me on this. plzzzzzzzz

Recommended Answers

All 4 Replies

Dim txtString as String
txtString=Trim(textbox1.Text)

This will work only if you have not created a textbox array. The best is to show us the code you use to create your textboxes to receive sensible help

hi do you specify names for the textboxes i.e. something like this:

sub CreateTextboxes()
    dim i as integer =0
    dim txtbox as textbox
    do while i < 5
        txtbox =  new textbox
        txtbox.name = "TxtBox" & i
        '....
        i = i + 1
    wend
end sub

If so you should be able to specify by name

Dim txtString as String
txtString=Trim(textbox1.Text)

as G Waddell describe, You should specify the textboxname:

    sub CreateTextboxes()
    dim i as integer =0
    dim txtbox as textbox
    do while i < 5
    txtbox = new textbox
    txtbox.name = "TxtBox" & i
    '....
    i = i + 1
    wend
    end sub

and then ttry to call data from text box.
I also think this is the reason you may not call the data.
as like:
on buttin click: messagebox.show(textbox1.text)
if solutin don't work then please elaborate your thread

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.