Can anybody give me a code that generates a textbox on a form, even in runtime
i have see a similar code but i forgot how it is done, all i know is that you will initialize a textbox into a control array then set its visible properties to false, then i forgot how to call that textbox
then set its location on the form, then setting its visible properties
to true
thanx for the help in advance
Comments
: i have see a similar code but i forgot how it is done, all i know is that you will initialize a textbox into a control array then set its visible properties to false, then i forgot how to call that textbox
: then set its location on the form, then setting its visible properties
: to true
: thanx for the help in advance
:
:
Hi,
the easiest way is to create the 1st textbox manually, let's call it txtX, set Visible=False and Index=0.
When you need to create the 1st textbox, use txtX(0) and just set it's Visible=True and Left=, Top=..
When you need to create another one (with number Index)
[code]Load txtX(Index)
txtX(Index).Visible=True
txtX(Index).Top= ...
txtX(Index).Left= ...[/code]
And you can access txtX(Index).Text to get the text of it.. You can also write event hander for 1st textbox and use Index parametr to determine, which on raised your event..
Hope this helps
[blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
[purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
: : i have see a similar code but i forgot how it is done, all i know is that you will initialize a textbox into a control array then set its visible properties to false, then i forgot how to call that textbox
: : then set its location on the form, then setting its visible properties
: : to true
: : thanx for the help in advance
: :
: :
: Hi,
: the easiest way is to create the 1st textbox manually, let's call it txtX, set Visible=False and Index=0.
: When you need to create the 1st textbox, use txtX(0) and just set it's Visible=True and Left=, Top=..
: When you need to create another one (with number Index)
: [code]Load txtX(Index)
: txtX(Index).Visible=True
: txtX(Index).Top= ...
: txtX(Index).Left= ...[/code]
: And you can access txtX(Index).Text to get the text of it.. You can also write event hander for 1st textbox and use Index parametr to determine, which on raised your event..
:
: Hope this helps
:
: [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
:
: [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
:
:
:
Thank you very much, your code really works, I used it to initialized my login screen, similar to windows, by counting the number of accounts in a record, then I displayed the number of required textbox(es) so that each user can type his/her password under his/her Username label
the label is also in a control array so that i can generate those too, thank you again,more power,god bless