Results 1 to 3 of 3

Thread: Adding TextBox, Labels, ... during RunTime

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    1

    Adding TextBox, Labels, ... during RunTime

    Hi,

    I have been working a while with VBa and I was wondering if it is possible to add a new TextBox or Listbox on the Form during Runtime.

    Eg: you click a button 3 new textfields appear on the form.
    I could already add them and make them invisible but this isn't the idea. I realy want to add a completely new fields and as many times I click on the button.

    I used to know it how to do it in VB 6 but unfortunately I forgot.. I know a real shame on me...

    Thx for your help.

    Odec

  2. #2
    Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    44

    VBA cannot do this....

    In VB6 you can add a new textbox to a textbox control array at runtime, only if one already exists on the form in design time.

    In VBA you cannot add controls at runtime. It is one of the real irritation I am having on my VBA projects right now.

    In VB.Net, you can add controls whenever you want, and you can add event handlers to each control, and create your own control arrays or collections in whatever manner you want.

    My advice, if possible move to VB.NET, if not you have to create the controls at design time.

  3. #3
    Addicted Member
    Join Date
    Oct 2000
    Location
    Vienna/Austria
    Posts
    132
    Hi Odec,

    look at http://www.j-walk.com/ss/excel/tips/tip76.htm

    there you find, what you want.

    have a nice day

    TheOnly

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