Click to See Complete Forum and Search --> : Creating controls at run time
Niranjan Wickramartne
Dec 31st, 1999, 04:12 AM
Can anyone tell me how to create text boxes with captions & place them on different locations of the form at run time using mouse/keyboard please? Or is there a way to create these fields (text boxes) using a combination of keys? (I.e. INS to insert (begin) a field & then space bar to create the length & finally DEL to end field?.
Thanks
Niranjan
Doomstar
Dec 31st, 1999, 09:41 PM
Well, you could create one or more (depends on how many you need) text boxes in the environment with the Visible property to False. Then use the Move method to get the text box in the right position and set the Visible property to True.
You can use the Keypress/MouseClick events to get the mouse/key combos to work.
------------------
Doomstar
http://come.to/Doomstar
Drazzy
Jan 2nd, 2000, 04:45 PM
Simply put one textbox on your form and give it index nr. 0. Then name it "textbox". Also make it invisible and make sure your users will NEVER touch textbox 0, unless you want all entered text to appear in all new created textboxes.
Whenever you'd like to have a new textbox around, simply use :
Load Textbox(Textbox.Count+1)
To set it's location, use
Textbox(Textbox.Count).Top = Y
Textbox(Textbox.Count).Left = X
Then make it visible using
Textbox(Textbox.Count).visible=True
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.