Results 1 to 6 of 6

Thread: creating objects at runtime [resolved]

  1. #1

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090

    Question creating objects at runtime [resolved]

    Ho do I make an object at runtime? Lets say I want a textbox to appear everytime someone clicks on a button, how would I do that?
    Last edited by Acidic; Nov 22nd, 2003 at 10:11 AM.
    Have I helped you? Please Rate my posts.

  2. #2
    Fanatic Member MikkyThomeon's Avatar
    Join Date
    Oct 2002
    Location
    At work...
    Posts
    648
    The easiest wat is to create a control array on the form eg: text1(0). You do this by adding a textbox and setting its index.

    While the program is running you call :

    VB Code:
    1. load text1(1)

    Next you set the properties of the new control and set its visible property to true.

    This way you will be able to reponsd to events of controls loaded dynamically without having to use subclassing.

  3. #3

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    I'm sorry but I'm a slow learner. Could you please walk me through how to do just that?

    What I really need is a 20 by 20 grid of frames which are empty. I then need to name them in a way where the bottom left one is 1,1 and the top right one 20,20.
    Have I helped you? Please Rate my posts.

  4. #4
    Fanatic Member MikkyThomeon's Avatar
    Join Date
    Oct 2002
    Location
    At work...
    Posts
    648

    try this

    Dear sir

    Please find your solution enclosed herewith

    Regards
    Mike Thomson!!!
    Attached Files Attached Files

  5. #5

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    wow, that was formal, thx anyway.
    Regards Sid.
    Have I helped you? Please Rate my posts.

  6. #6
    Fanatic Member MikkyThomeon's Avatar
    Join Date
    Oct 2002
    Location
    At work...
    Posts
    648
    Gladly mate!!!

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