Results 1 to 3 of 3

Thread: Creating controls at run time

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    High Wycombe, United Kingdom
    Posts
    13

    Post

    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

  2. #2
    Junior Member
    Join Date
    Jan 2000
    Posts
    24

    Post

    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

  3. #3
    New Member
    Join Date
    Jan 2000
    Posts
    1

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width